A data processing method and apparatus
By dividing the data sequence into array pairs and calculating the index loss, the step dividing line and abnormal regions are determined, which solves the problem of inaccuracy in the analysis of stepped distribution data in the existing technology and realizes more efficient data anomaly analysis and abnormal behavior detection.
Patent Information
- Application Number
- CN202211397238.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-09
- Publication Date
- 2026-02-17
- Estimated Expiration
- 2042-11-09
AI Technical Summary
Existing data analysis methods cannot effectively handle stepped distribution data, resulting in large errors in the analysis results of data anomalies and failing to accurately detect abnormal behavior.
By dividing the data sequence into multiple array pairs, each array pair having two complementary data sets, the index loss is calculated to determine the target array pair, and abnormal index values and abnormal behaviors are determined based on the index values on both sides of the step dividing line.
It improves the accuracy of data anomaly analysis, effectively detects abnormal behaviors related to data anomalies, reduces the uncertainty of manual monitoring, lowers costs, and improves work efficiency.
Smart Images

Figure CN115544152B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of e-commerce and information security, and in particular to a data processing method and device. BACKGROUND
[0002] By analyzing the operating data of e-commerce and other retail enterprises, such as the sales volume of the goods sold, the purchase price, the selling price, and the data generated by the advertisement, the operating cost of e-commerce and other retail enterprises can be controlled, and the abnormal problems of the sales volume of the goods sold, the abnormal behavior of the merchant, such as the problem of brushing, sales fraud, and vicious competition, can be found.
[0003] At present, the analysis of the operating data of e-commerce and other retail enterprises is mainly completed by setting an abnormal threshold, constructing a linear regression, and clustering. However, for the stepwise distribution data with the characteristics of segmented continuity, such as the cliff or stepwise decline of the purchase price or selling price of the old goods after the iteration of the goods update, such as the listing of new electronic products, and the relatively stable price in a period of time, the existing data analysis method does not analyze the segmented data according to the segmented characteristics of the stepwise distribution data due to the analysis of the overall data, resulting in a large error of the analysis result and an inaccurate analysis of the data abnormality. SUMMARY
[0004] Therefore, the embodiments of the present application provide a data processing method and device, which can segmentally analyze the stepwise distribution data to effectively improve the accuracy of the data abnormality analysis and accurately find the abnormal behavior related to the data abnormality.
[0005] To achieve the above-mentioned purpose, according to one aspect of the embodiments of the present application, a data processing method is provided, which comprises:
[0006] receiving a data processing request, wherein the data processing request comprises a to-be-analyzed index;
[0007] obtaining a data sequence corresponding to the to-be-analyzed index, wherein the data sequence comprises index values corresponding to a plurality of time points of the to-be-analyzed index;
[0008] dividing the plurality of index values included in the data sequence into a plurality of array pairs, wherein each array pair has two complementary data groups, each data group is composed of an index value or a plurality of index values of continuously changed time points, all index values included in the two complementary data groups correspond to all index values included in the data sequence in one-to-one correspondence, and the time points of the index values included in the two complementary data groups do not overlap;
[0009] calculating an index loss of each of the array pairs according to index values included in two complementary data groups of the array pair;
[0010] determining a target array pair with a minimum index loss according to the index losses of the array pairs;
[0011] respectively determining an abnormal index value of each of the data groups in the target array pair and an abnormal behavior corresponding to the abnormal index value;
[0012] pushing the abnormal index value and the abnormal behavior corresponding to the abnormal index value to a management end.
[0013] Optionally, the data processing request further includes a data type;
[0014] In a case where the data type satisfies a preset data processing condition, performing the step of dividing the plurality of index values included in the data sequence into the array pairs.
[0015] Optionally, the dividing the plurality of index values included in the data sequence into the array pairs includes:
[0016] constructing an initial segmentation point between each two adjacent time points;
[0017] for each of the initial segmentation points, dividing index values located on two sides of the initial segmentation point into two complementary data groups to form an array pair.
[0018] Optionally, the calculating the index loss of the array pair includes:
[0019] calculating an array mean of the two complementary data groups of the array pair;
[0020] for each of the index values, calculating a variance of the index value relative to the array mean of the data group to which the index value belongs;
[0021] accumulating the variances corresponding to each of the index values to obtain the index loss of the array pair.
[0022] Optionally, the data processing method further includes:
[0023] selecting an actual segmentation point corresponding to the array pair with the minimum index loss from the plurality of initial segmentation points, and determining a straight line passing through the actual segmentation point as a step segmentation line of the data sequence, wherein each point on the step segmentation line corresponds to a time point of the actual segmentation point, and index values corresponding to each point on the step segmentation line are different;
[0024] The respectively determining an abnormal index value of each of the data groups in the target array pair includes:
[0025] According to the index values distributed on both sides of the step division line, the abnormal index values distributed on both sides of the step division line are determined respectively.
[0026] Optionally, the constructing of the initial division point between each two adjacent time points comprises:
[0027] The intermediate point between each two adjacent time points is determined as the initial division point.
[0028] Optionally, the determining of the abnormal index values comprises:
[0029] According to the step division line and the index values distributed on both sides of the step division line, an abnormal region is divided on both sides of the step division line;
[0030] From the plurality of index values included in the data sequence, abnormal index values located in the abnormal region are screened out.
[0031] Optionally, the dividing of the abnormal region on both sides of the actual division point comprises:
[0032] A two-dimensional coordinate system is drawn, wherein one coordinate axis in the two-dimensional coordinate system corresponds to the time points in the data sequence, and the other coordinate axis corresponds to the to-be-analyzed index, and the step division line is parallel to the other coordinate axis;
[0033] According to the mean value of the index values distributed on both sides of the step division line, a straight line corresponding to the mean value is drawn on both sides of the step division line respectively, and a curve connecting the two straight lines is drawn;
[0034] According to the index value corresponding to the intersection point of the drawn curve connecting the two straight lines and the actual division line and the preset abnormal tolerance, abnormal boundary values on both sides of the step division line are determined;
[0035] According to the abnormal boundary values, an abnormal boundary curve perpendicular to the other coordinate axis is drawn on both sides of the step division line respectively;
[0036] The abnormal boundary curve on each side of the step division line is determined as a starting point, and the region of the straight line corresponding to the mean value away from the side is determined as the abnormal region of the side.
[0037] Optionally, the data processing request further comprises a data change parameter;
[0038] The data processing method further comprises: according to the data change parameter, dividing the data sequence into a plurality of data subsequences, wherein each two adjacent data subsequences include a plurality of coincident time points and corresponding index values;
[0039] The multiple index values included in the data sequence are divided into multiple array pairs, including dividing the multiple index values included in each data sub-sequence into multiple array pairs.
[0040] In a second aspect, an embodiment of the present application provides a data processing apparatus, including a receiving module, a data analysis module and a pushing module, wherein,
[0041] The receiving module is configured to receive a data processing request, wherein the data processing request includes an index to be analyzed.
[0042] The data analysis module is configured to obtain a data sequence corresponding to the index to be analyzed, wherein the data sequence includes index values corresponding to multiple time points of the index to be analyzed; divide the multiple index values included in the data sequence into multiple array pairs, wherein each array pair has two complementary data groups, each data group is composed of an index value or multiple index values of continuously changing time points, all index values included in the two complementary data groups correspond to all index values included in the data sequence one by one, and the time points of the index values included in the two complementary data groups do not overlap; for each array pair, calculate the index loss of the array pair according to the index values included in the two complementary data groups of the array pair; determine the step division line of the data sequence according to the index losses of multiple array pairs; determine a target array pair with the minimum index loss according to the index losses of multiple array pairs; determine an abnormal index value of each data group in the target array pair and an abnormal behavior corresponding to the abnormal index value, respectively.
[0043] The pushing module is configured to push the abnormal index value and the abnormal behavior to a management end.
[0044] An embodiment of the above application has the following advantages or benefits: by dividing the multiple index values included in the data sequence into multiple array pairs, each array pair has two complementary data groups, each data group is composed of an index value or multiple index values of consecutive time points, all index values included in the two complementary data groups correspond to all index values included in the data sequence one by one, and the time points of the index values included in the two complementary data groups do not overlap, then by calculating the index loss of the array pair, the data sequence is segmented, that is, the target array pair with the minimum index loss is determined. Then according to the index values distributed on both sides of the step segmentation line, the abnormal index values of each data group in the target array pair and the abnormal behaviors corresponding to the abnormal index values are determined, that is, the data sequence is segmented, then the abnormal index values and the abnormal behaviors of each segment are determined, the step distribution data is segmented and analyzed, the mutual interference of the data with large differences is avoided, and the accuracy of the data anomaly analysis is effectively improved, so that the abnormal behaviors related to the data anomaly can be accurately found.
[0045] The further effects of the above-mentioned non-conventional optional mode will be described in the following combined with the specific embodiments. BRIEF DESCRIPTION OF DRAWINGS
[0046] The accompanying drawings are used to better understand the application and do not constitute undue limitations on the application. Among them:
[0047] Figure 1 is an exemplary system architecture diagram to which embodiments of the application can be applied;
[0048] Figure 2 is a schematic diagram of the main process of the data processing method according to the embodiments of the application;
[0049] Figure 3 is a schematic diagram of the main process of dividing the data sequence into multiple array pairs according to the embodiments of the application;
[0050] Figure 4 is a schematic diagram of the relationship between the initial segmentation point, the actual segmentation point and the step segmentation line of the data sequence according to the embodiments of the application;
[0051] Figure 5 is a schematic diagram of the main process of calculating the index loss of the array pair according to the embodiments of the application;
[0052] Figure 6 is a schematic diagram of the main process of dividing the abnormal area on both sides of the actual segmentation point according to the embodiments of the application;
[0053] Figure 7 is a schematic diagram of the relationship between the step segmentation line, the abnormal boundary curve and the abnormal area according to the embodiments of the application;
[0054] Figure 8 is a schematic diagram of the main flow of a data processing method according to another embodiment of the present application;
[0055] Figure 9 is a schematic diagram of the main modules of a data processing apparatus according to an embodiment of the present application;
[0056] Figure 10 is a structural schematic diagram of a computer system of a terminal device or a server suitable for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0057] Exemplary embodiments of the present application are described herein with reference to the accompanying drawings, which are meant to be exemplary and not limiting. Therefore, it should be recognized that many modifications and variations of the exemplary embodiments described herein can be made by those of ordinary skill in the art without departing from the scope and spirit of the application. Also, for the sake of brevity and clarity, descriptions of well-known functions and constructions are omitted from the following description.
[0058] Figure 1 An exemplary system architecture 100 to which embodiments of the present application can be applied is shown.
[0059] As shown in Figure 1 , the system architecture 100 can include terminal devices 101, 102, 103 of data managers, a network 104, a database 105 managing data, and a server 106. The network 104 is used to provide a medium of communication link between the terminal devices 101, 102, 103 of the data managers and the server 106, and between the database 105 and the server 106. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0060] The data managers can use the terminal devices 101, 102, 103 to interact with the server 106 through the network 104 to receive or send information, etc. Various communication client applications can be installed on the terminal devices 101, 102, 103, such as data display applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0061] The database 105 managing data can store various data, such as purchase information of an e-commerce platform, such as suppliers, supply prices, purchase dates, etc., sales dates, sales volumes, prices, return volumes of different goods of the e-commerce platform, and operating costs of the enterprise, such as advertising expenses, etc.
[0062] The server 106 can be a server providing various services, such as a background management server providing support for data managed by the database 105 (as an example only). The background management server can process data obtained from the database 105 and provide the results of the processing (such as outliers and abnormal behavior of the data, as examples only) to the terminal devices 101, 102, 103.
[0063] The terminal devices 101, 102, 103 can be various electronic devices having a display screen and supporting web browsing, including but not limited to smartphones, tablet computers, laptop computers, desktop computers, and the like.
[0064] It should be noted that the data processing method provided by the embodiments of the present application is generally executed by the server 106, and accordingly, the data processing apparatus is generally provided in the server 106.
[0065] It should be understood that Figure 1 The number of terminal devices, networks, databases, and servers in the above description is merely illustrative. Any number of user terminal devices, networks, databases, and servers can be provided as needed.
[0066] Figure 2 is a main flow diagram of a data processing method according to an embodiment of the present application. As shown in Figure 2 the data processing method can include the following steps:
[0067] Step S201: receiving a data processing request, wherein the data processing request includes an index to be analyzed;
[0068] The data processing request can be initiated by a user (such as a supervisory department of an enterprise, etc.) according to needs, or can be initiated by a pre-set timing trigger task.
[0069] The index to be analyzed can be the number of messages received by each mobile phone number for a certain advertisement, or can be the purchase price of an item (such as office supplies, goods sold on an e-commerce platform, etc.), the price of a good sold on an e-commerce platform, sales volume, etc.
[0070] Step S202: obtaining a data sequence corresponding to the index to be analyzed, wherein the data sequence includes index values of the index to be analyzed corresponding to a plurality of time points;
[0071] For example, if the index to be analyzed is the purchase price of an item, the data sequence can include the purchase price of the item at each time point within a time period. For another example, if the index to be analyzed is the sales volume of an item, the data sequence can include the sales volume of the item at each time point within a time period.
[0072] In addition, the granularity of the time point can be set according to user requirements, such as one day, one hour, one month, one week, etc.
[0073] The data sequence includes respective index values corresponding to the time points.
[0074] The following describes the data sequence in detail by taking the relationship between the purchase price y (in yuan) of an article and the purchase time x (in weeks) shown in Table 1 as an example.
[0075] Table 1
[0076] x 1 2 2 2 3 3 4 5 6 7 8 9 9 10 y 15 4 15 14 15 14 13.5 14 8 3 2 8 2 2
[0077] As shown in Table 1, there are three purchase prices of the article in the second week (the three purchase prices can be caused by different suppliers or different purchase times in the second week), two purchase prices in the third week, and two purchase prices in the ninth week.
[0078] In the case that one time point corresponds to multiple index values as shown in Table 1, the average of the index values corresponding to the time point is generally taken as the index value of the time point, such as the index value 11 corresponding to the time point 2 weeks, the index value 14.5 corresponding to the time point 3 weeks, and the index value 5 corresponding to the time point 9 weeks, so as to ensure that the time points and the index values correspond to each other one by one. The data sequence obtained for the data in Table 1 is shown in Table 2.
[0079] Table 2
[0080] x 1 2 3 4 5 6 7 8 9 10 y 15 11 14.5 13.5 14 8 3 2 5 2
[0081] Step S203: dividing the multiple index values included in the data sequence into multiple array pairs, wherein each array pair has two complementary data groups, each data group is composed of an index value or multiple index values of continuously changing time points, all index values included in the two complementary data groups correspond to all index values included in the data sequence one by one, and the time points of the index values included in the two complementary data groups do not overlap;
[0082] Step S204: for each array pair, calculating the index loss of the array pair according to the index values included in the two complementary data groups of the array pair.
[0083] The index loss of the array pair can measure the balance of the two complementary data groups possessed by the array pair, that is, the smaller the index loss of the array pair, the more balanced the division of the two complementary data groups possessed by the array pair, the larger the index loss of the array pair, the unbalanced division of the two complementary data groups possessed by the array pair. The more balanced the division of the two complementary data groups possessed by the array pair, the more reasonable the array pair is constructed, so as to measure the rationality of the step position division of the step distribution data. The step distribution data is reasonably divided into data groups.
[0084] Step S205: determining a target array pair with the minimum index loss according to the index losses of the plurality of array pairs;
[0085] Step S206: determining an abnormal index value of each data group in the target array pair and an abnormal behavior corresponding to the abnormal index value, respectively.
[0086] The abnormal behavior can be determined according to a pre-set mapping relationship between an index interval and an abnormal behavior. For example, for sales, a high sales index interval can be mapped to a single brushing behavior, sales fraud, etc., for example, a purchase price exceeding a certain index abnormal interval can be mapped to a purchase cost anomaly, for example, an abnormal index of a sales price in another index abnormal interval can be mapped to vicious competition, refurbished sales, etc. Step S207: pushing the abnormal index value and the abnormal behavior to the management end.
[0087] It should be noted that the scheme provided by the embodiment of the present application is mainly for scenarios such as e-commerce platforms, warehouses, etc. involving large data volume, many data indicators and step distribution of data.
[0088] In addition, in addition to the above scenarios, the technical scheme can also be applied to an advertisement placement scenario. For the advertisement placement scenario, the above-mentioned to-be-analyzed indicators can be the frequency of placing an advertisement for a placement target or the coverage range of the placement target, etc. Correspondingly, in the case of an abnormal index value due to the frequency of placing an advertisement for a certain placement target being too high or the coverage range of the placement target being too single, etc., the above-mentioned scheme can be used to monitor the advertisement placement to avoid waste of resources.
[0089] In Figure 2In the illustrated embodiment, by dividing the plurality of index values included in the data sequence into a plurality of array pairs, each array pair has two complementary data groups, each data group is composed of an index value or a plurality of index values of consecutive time points, all index values included in the two complementary data groups correspond one-to-one to all index values included in the data sequence, and the time points of the index values included in the two complementary data groups do not overlap, then by calculating the index loss of the array pair, the data sequence is segmented, that is, the target array pair with the minimum index loss is determined. Then, according to the index values distributed on both sides of the step segmentation line, the abnormal index values of each data group in the target array pair and the abnormal behaviors corresponding to the abnormal index values are determined, that is, the data sequence is segmented, and then the abnormal index values and the abnormal behaviors of each segment are determined. The stepwise distribution data is segmented and analyzed, the mutual interference of the data with large differences is avoided, the accuracy of data anomaly analysis is effectively improved, and the abnormal behaviors related to data anomalies are accurately found.
[0090] In addition, in the case of accurately finding abnormal index values, the scheme provided by the embodiment of the present application can assist the supervisors of enterprises to timely find abnormalities and find out the causes of abnormalities. The uncertainty of the previous manual sampling monitoring is reduced, the labor cost is reduced, and the work efficiency is improved.
[0091] Further, the data processing request can further include a data type. Correspondingly, in a case where the data type satisfies a preset data processing condition, the step of dividing the plurality of index values included in the data sequence into a plurality of array pairs is performed. The data type can be a type matched with the to-be-analyzed index, for example, for the price to-be-analyzed index, the data type is the price changing over time, for the sales to-be-analyzed index, the data type is the sales changing over time, and the like. In addition, the data type can also be data directly indicating that the index values of the to-be-analyzed index in the obtained data sequence are stepwise distributed. Correspondingly, the data processing condition can be defined as the data type to be processed. That is, through the process, only the stepwise distributed data is processed according to the data processing method provided by the embodiment of the present application, and other types of data can be processed by using the existing data processing methods such as abnormal threshold setting, linear regression and classification algorithm, and the like. The existing data processing method is not the technical solution to be protected by the embodiment of the present application, and will not be described here.
[0092] It is worth noting that the technical solution provided by the embodiment of the present application and the existing data processing method can be packaged into the same device to meet the needs of different data processing.
[0093] In the embodiment of the present application, as Figure 3As shown in the above embodiment, the step of dividing the plurality of index values included in the data sequence into a plurality of array pairs can include the following steps:
[0094] Step S301: constructing an initial split point between each adjacent two time points;
[0095] The data sequence shown in Table 2 above is taken as an example to illustrate each adjacent two time points and the initial split point. Each adjacent two time points are: 1 and 2, 2 and 3, 3 and 4, 4 and 5, 5 and 6, 6 and 7, 7 and 8, 8 and 9. The initial split point can be any value between the adjacent two time points, for example, for the adjacent two time points 1 and 2, the initial split point can be 1.1, 1.2, 1.3, 1.5, 1.7, 1.9, etc.
[0096] Step S302: for each initial split point, dividing the index values on both sides of the initial split point into two complementary data groups to form an array pair.
[0097] The embodiment of constructing an initial split point between each adjacent two time points can include: determining the middle point of each adjacent two time points as the initial split point. This facilitates the determination of the initial split point, facilitates the subsequent determination of the abnormal boundary value, and improves the accuracy of the abnormal boundary value.
[0098] For example, for Table 2, determining the middle point of each adjacent two time points as the initial split point can be as shown in Table 3.
[0099] Table 3
[0100] Initial split point 1.50 2.50 3.50 4.50 5.50 6.50 7.50 8.50 9.50
[0101] For the initial split point 1.5, the two complementary data groups in the corresponding array pair are: {15}, {11, 14.5, 13.5, 14, 8, 3, 2, 5, 2}; for the initial split point 2.5, the two complementary data groups in the corresponding array pair are: {15, 11}, {14.5, 13.5, 14, 8, 3, 2, 5, 2}; for the initial split point 3.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5}, {13.5, 14, 8, 3, 2, 5, 2}; for the initial split point 4.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5, 13.5}, {14, 8, 3, 2, 5, 2}; for the initial split point 5.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5, 13.5, 14}, {8, 3, 2, 5, 2}; for the initial split point 6.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5, 13.5, 14, 8}, {3, 2, 5, 2}; for the initial split point 7.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5, 13.5, 14, 8, 3}, {2, 5, 2}; for the initial split point 8.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5, 13.5, 14, 8, 3, 2}, {5, 2}; for the initial split point 9.5, the two complementary data groups in the corresponding array pair are: {15, 11, 14.5, 13.5, 14, 8, 3, 2, 5}, {2}.
[0102] In the embodiments of the present application, as shown in FIG. 1, the specific implementation of the above step of calculating the index loss of the array pair can include the following steps: Figure 4
[0103] Step S401: calculating the array mean of the two complementary data groups of the array pair;
[0104] The specific implementation of the step S401 can be calculated by the following formula (1).
[0105]
[0106] wherein, C i represents the array mean of the data group i in the array pair f; n represents the total number of index values included in the data group i; y ij represents the jth index value included in the data group i.
[0107] Step S402: for each index value, calculating the variance of the index value relative to the array mean of the data group to which the index value belongs;
[0108] This step can be calculated by the following calculation formula (2).
[0109] K fij = (y ij - C i ) 2 (2)
[0110] wherein, K fij characterizes the variance of the jth index value included in the ith data group of the array pair f relative to the array mean C i of the data group to which it belongs.
[0111] Step S403: Accumulate the variance corresponding to each index value to obtain the index loss of the array pair.
[0112] This step can be calculated by the following calculation formula (3).
[0113]
[0114] wherein, LOSS f characterizes the index loss of the array pair f; K f1j characterizes the variance of the jth index value included in the first data group of the array pair f relative to the array mean C i of the first data group to which it belongs; N characterizes the total number of index values included in the first data group of the array pair f; K f2j characterizes the variance of the jth index value included in the second data group of the array pair f relative to the array mean C i of the second data group to which it belongs; M characterizes the total number of index values included in the second data group of the array pair f.
[0115] For example, for the data sequence shown in Table 2 above, the initial split points of each data group, the mean of each array, the variance of the index value included in the data group relative to the array mean of the data group to which it belongs, and the index loss of each array pair can be shown in Table 4 as follows.
[0116] Table 4
[0117]
[0118] The index loss obtained by the above calculation can better evaluate whether the array pair cut is reasonable to ensure that the data can be cut according to its step distribution.
[0119] In addition, in the above Figure 3On the basis of the embodiment shown, the data processing method can further include: screening the actual segmentation point corresponding to the array pair of the minimum index loss from the plurality of initial segmentation points, and determining a straight line passing through the actual segmentation point as a ladder segmentation line of the data sequence, wherein each point on the ladder segmentation line corresponds to a time point of the actual segmentation point, and the index values corresponding to each point on the ladder segmentation line are all different; accordingly, the specific implementation of determining the abnormal index value of each data group in the target array pair can include: determining the abnormal index values distributed on both sides of the ladder segmentation line according to the index values distributed on both sides of the ladder segmentation line.
[0120] As shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point. Figure 5 As shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point. Figure 5 As shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point.
[0121] On the basis of the ladder segmentation line, the specific implementation of determining the abnormal index value can include: dividing an abnormal area on both sides of the ladder segmentation line according to the ladder segmentation line and the index values distributed on both sides of the ladder segmentation line; and screening the abnormal index value located in the abnormal area from the plurality of index values included in the data sequence.
[0122] Specifically, as shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point. Figure 6 Specifically, as shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point.
[0123] Step S601: drawing a two-dimensional coordinate system, wherein one coordinate axis of the two-dimensional coordinate system corresponds to the time point in the data sequence, and the other coordinate axis corresponds to the index to be analyzed, and the ladder segmentation line is parallel to the other coordinate axis.
[0124] As shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point. Figure 7 Step S602: drawing a straight line corresponding to the mean value on both sides of the ladder segmentation line according to the mean value of the index values distributed on both sides of the ladder segmentation line, and drawing a curve connecting the two straight lines.
[0125] As shown in the variation process of the above Tables 2 to 4, first, a two-dimensional coordinate system is constructed, wherein the y-axis of the coordinate system is the index value of the index to be analyzed, and the x-axis is the time point.
[0126] Figure 7 As shown, the mean value of the index distributed to the left of the step dividing line l is 13.1, and the mean value of the index distributed to the right of the step dividing line l is 4.2. That is, draw a straight line with y = 13.1 to the left of the step dividing line l, and a straight line with y = 4.2 to the right of the step dividing line l. Draw curve L' connecting the straight lines y = 13.1 and y = 4.2.
[0127] Step S603: Determine the abnormal boundary values on both sides of the stepped dividing line based on the index values corresponding to the intersection points of the curve connecting the two straight lines and the actual dividing line, as well as the preset abnormal tolerance.
[0128] For example, such as Figure 7 The plotted curve L' connecting the two straight lines and the intersection point O' of the actual dividing line l are used to determine the abnormal boundary values on both sides of the stepped dividing line, along with the corresponding index value and anomaly tolerance. This anomaly tolerance can be set according to requirements. For example, if the tolerance is 0, the abnormal boundary value is y = the index value corresponding to the intersection point O'; or, if the tolerance is 20%, the abnormal boundary value on the left side of the actual dividing line l is y equal to (1-20%) of the index value corresponding to the intersection point O', meaning the abnormal boundary value is y equal to 80% of the index value corresponding to the intersection point O', i.e., a 20% downward fluctuation relative to the index value corresponding to the intersection point O'; the abnormal boundary value on the left side of the actual dividing line l is y equal to (1+20%) of the index value corresponding to the intersection point O', meaning the abnormal boundary value is y equal to 120% of the index value corresponding to the intersection point O', i.e., a 20% upward fluctuation relative to the index value corresponding to the intersection point O'.
[0129] Step S604: Based on the abnormal boundary value, draw abnormal boundary curves perpendicular to the other coordinate axis on both sides of the stepped dividing line;
[0130] like Figure 7 The abnormal boundary curve R1 is shown to the left of the stepped dividing line perpendicular to the y-axis, and the abnormal boundary curve R2 is shown to the right of the stepped dividing line perpendicular to the y-axis.
[0131] Step S605: Determine the abnormal boundary curve on each side of the stepped dividing line as the starting point, and the area of the straight line corresponding to the mean that is far away from that side is the abnormal area on that side.
[0132] like Figure 7 As shown, to the left of the stepped dividing line, the region T1 starts from the abnormal boundary curve R1 and is far away from the branch line y = 13.1. To the right of the stepped dividing line, the region T2 starts from the abnormal boundary curve R2 and is far away from the branch line y = 4.2.
[0133] In the embodiments of the present application, the data processing request can further include a data change parameter, and the data processing method can further include: dividing the data sequence into a plurality of data subsequences according to the data change parameter, wherein each adjacent two data subsequences include a plurality of coincident time points and corresponding index values. The specific implementation of dividing the plurality of index values included in the data sequence into a plurality of array pairs can include: dividing the plurality of index values included in each data subsequence into a plurality of array pairs. Through the process, the accuracy of index value division can be further improved, and the accuracy of abnormal index values and abnormal behaviors can be improved.
[0134] The following is an example of the sales data of the items sold by the e-commerce platform to illustrate the data processing process provided by the embodiments of the present application. As shown in the following figure, Figure 8 The data processing method can include the following steps:
[0135] Step S801: receiving a data processing request, wherein the data processing request includes an index to be analyzed, a data type, and a data change parameter;
[0136] The data processing request can be initiated by a user (such as a commodity supervision department of an e-commerce platform) according to demand, or can be initiated by a pre-set timing trigger task.
[0137] For the sales of items sold by the e-commerce platform, the index to be analyzed can be the sales index corresponding to a specific item (such as item name, item code sku), such as the sales of item A every day, the sales of item B every day, etc.
[0138] For the price of the items sold by the e-commerce platform, the index to be analyzed can be the single-piece price index corresponding to a specific item (such as item name, item code sku), such as the sales price of item A every day, the sales price of item B every day, etc.
[0139] In a certain data processing time period, which kind of sales of which kind of item, and the time period to which the data processing is directed (such as the sales and / or the sales price of item A every day in the entire event period from the sales of item A to the current time, etc.) can be defined according to actual demand.
[0140] The data type can be step distribution data, curve data, etc., or can be a type matched with the index to be analyzed, such as the price of a single item (i.e. unit price) changing with time for the price of an item, the sales of an item per unit time (every day, every hour, every month, etc.) changing with time for the sales of an item, etc.
[0141] The data change parameter can be a parameter indicating a data change period, an index threshold value required to be exceeded between index values of different times of the index to be analyzed, and the like. For example, an electronic product is lowered in price every year / half year / quarter with the release of a new product, and the change period (e.g., one year / half year / quarter) or 2 times the change period (e.g., two years / year / half year) of the electronic product and the starting time point or the change time point corresponding to the change period. For example, for a certain electronic product, the price difference (e.g., the difference between the price of the first generation product at the beginning of the release and the price of the first generation product after the release of the third generation, the difference between the price of the first generation product after the release of the third generation and the price of the first generation product after the release of the fifth generation, the difference between the price of the first generation product after the release of the second generation and the price of the first generation product after the release of the fourth generation) of every two generations of the electronic product is generally not less than 2000, and the 2000 can be used as the price segmentation difference of the electronic product. For example, the price at the beginning of the release is used as the reference, and the difference between the price at each time point and the price at the beginning of the release is not less than 2000, and the time point at which the difference exceeding 2000 first appears is used as the segmentation point of the data subsequence.
[0142] Step S802: obtaining a data sequence corresponding to the index to be analyzed, wherein the data sequence includes index values of the index to be analyzed corresponding to a plurality of time points;
[0143] For example, for the sales of a certain product, the data sequence generally includes the sales value of the product every day.
[0144] For the price of a certain product, if the change of the price over time is monitored and abnormal selling price / purchasing price is found, the data sequence generally includes the unit price of the product sold every day, the purchasing price corresponding to different suppliers, and the like.
[0145] Step S803: dividing the data sequence into a plurality of data subsequences according to the data change parameter, wherein each adjacent two data subsequences include a plurality of overlapping time points and corresponding index values;
[0146] For example, the data change parameter of the electronic product S is to adjust the price of the product every half year, the start time is December 1, 2019, and the end date is December 1, 2022. The data sequence includes the sales price of the electronic product S every day from December 1, 2019 to December 1, 2022. The data sequence is divided into multiple data subsequences, respectively: data subsequence 1 including the sales price of the electronic product S every day from December 1, 2019 to December 1, 2020, data subsequence 2 including the sales price of the electronic product S every day from June 1, 2020 to June 1, 2021, data subsequence 3 including the sales price of the electronic product S every day from December 1, 2020 to December 1, 2021, data subsequence 4 including the sales price of the electronic product S every day from June 1, 2021 to June 1, 2022, and data subsequence 5 including the sales price of the electronic product S every day from December 1, 2021 to December 1, 2022.
[0147] The following steps are completed based on the data subsequence in the subsequent step.
[0148] In addition, for a data processing request without a data change parameter, the following steps are directly based on the data sequence corresponding to the data processing request.
[0149] Step S804: In the case where the data type meets the preset data processing condition, an initial segmentation point is constructed between each adjacent two time points for each data subsequence or data sequence.
[0150] The data processing condition can be pre-defined with multiple processable data types or stepwise distributed data. If the data type belongs to the processable data type pre-defined by the data processing condition or belongs to the stepwise distributed data included by the data processing condition, it is determined that the data type included in the data processing request meets the preset data processing condition.
[0151] Taking the sales volume or price counted by day as an example, the time points are generally 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, …, etc. The initial segmentation point between each adjacent two time points refers to any point between 1 and 2, any point between 2 and 3, any point between 3 and 4, any point between 4 and 5, etc. In order to facilitate the determination of the initial segmentation point, the initial segmentation point can be a fixed interval such as 0.1, 0.2, 0.6, etc. from the smaller / larger time point of the adjacent two time points. In a preferred embodiment, the initial segmentation point is the midpoint of the adjacent two time points, which facilitates the determination of the subsequent abnormal boundary value and effectively improves the accuracy of the abnormal boundary value.
[0152] Step S805: for each initial segmentation point, divide the indicator values located on both sides of the initial segmentation point into two complementary data groups, to form a plurality of array pairs;
[0153] Wherein, each array pair has two complementary data groups, each data group is composed of an indicator value or a plurality of continuously changing indicator values of time points, all indicator values included by the two complementary data groups one-to-one correspond to all indicator values included by the data sequence, and the time points of the indicator values included by the two complementary data groups completely do not overlap;
[0154] For example, the sales of the goods sold by the e-commerce platform within a period of time are as shown in Table 5.
[0155] Table 5
[0156] x (days) 1 2 3 4 5 6 7 8 9 10 y (pieces) 150 40 140 135 140 80 30 20 80 20
[0157] The initial segmentation points are 1.5, 2.5, 3.5, 4.5, 5.5, 6.5, 7.5, 8.5, and 9.5. Correspondingly, the initial segmentation point 1.5 corresponds to the array pair 1: the data set {150} and its complementary data set {40, 140, 135, 140, 80, 30, 20, 80, 20}; the initial segmentation point 2.5 corresponds to the array pair 2: the data set {150, 40} and its complementary data set {140, 135, 140, 80, 30, 20, 80, 20}; the initial segmentation point 3.5 corresponds to the array pair 3: the data set {150, 40, 140} and its complementary data set {135, 140, 80, 30, 20, 80, 20}; the initial segmentation point 4.5 corresponds to the array pair 4: the data set {150, 40, 140, 135} and its complementary data set {140, 80, 30, 20, 80, 20}; the initial segmentation point 5.5 corresponds to the array pair 5: the data set {150, 40, 140, 135, 140} and its complementary data set {80, 30, 20, 80, 20}; the initial segmentation point 6.5 corresponds to the array pair 6: the data set {150, 40, 140, 135, 140, 80} and its complementary data set {30, 20, 80, 20}; the initial segmentation point 7.5 corresponds to the array pair 7: the data set {150, 40, 140, 135, 140, 80, 30} and its complementary data set {20, 80, 20}; the initial segmentation point 8.5 corresponds to the array pair 8: the data set {150, 40, 140, 135, 140, 80, 30, 20} and its complementary data set {80, 20}; and the initial segmentation point 9.5 corresponds to the array pair 9: the data set {150, 40, 140, 135, 140, 80, 30, 20, 80} and its complementary data set {20}.
[0158] Step S806: For each array pair, calculate the array mean of the two complementary data sets of the array pair.
[0159] The array mean is obtained by summing the individual data included in the data set and dividing the sum by the number of data included in the data set.
[0160] For example, for the array pairs 1 to 9 constructed based on the data in Table 1, the mean of the data set with only one 150 in the array pair 1 is 150, and the mean of the other data set in the array pair 1 is obtained by summing the individual data (i.e., 40+140+135+140+80+30+20+80+20) and dividing the sum by the total number of data included in the data set (i.e., 9), which is 76.
[0161] The mean value of each data group included in the array pair 1 to 9 constructed by the data in Table 5 above can be shown in Table 6 as follows.
[0162] Table 6
[0163]
[0164] It is worth mentioning that the mean value including decimal in Table 6 can be rounded to only retain the integer part of the mean value, which can be set according to user needs, and is not limited here.
[0165] Step S807: For each index value, calculate the variance of the index value relative to the mean value of the array of the data group to which the index value belongs;
[0166] The step S807 calculates the variance of each index value relative to the mean value of the array of the data group to which the index value belongs, which can be calculated according to the above formula (2), and will not be repeated here.
[0167] Step S808: Accumulate the variance corresponding to each index value to obtain the index loss of the array pair;
[0168] The step S808 can be calculated according to the above formula (3), and will not be repeated here.
[0169] Step S809: Determine the target array pair with the minimum index loss according to the index loss of the plurality of array pairs;
[0170] The minimum index loss indicates that the two complementary data groups included in the target array pair are more balanced.
[0171] Step S810: Screen the actual split point corresponding to the array pair with the minimum index loss from the plurality of initial split points, and determine the straight line passing through the actual split point as the stepwise split line of the data sequence in the drawn two-dimensional coordinate system;
[0172] Each point on the stepwise split line corresponds to the time point of the actual split point, and the index values corresponding to each point on the stepwise split line are different;
[0173] One coordinate axis in the two-dimensional coordinate system corresponds to the time point in the data sequence, and the other coordinate axis corresponds to the to-be-analyzed index, and the stepwise split line is parallel to the other coordinate axis;
[0174] For example, the actual split point of the array pair with the minimum index loss obtained by the above process is 5.5, and the straight line passing through the coordinate point 5.5 and parallel to the coordinate axis indicating the to-be-analyzed index is the stepwise split line. The process of drawing the two-dimensional coordinate system and the stepwise split line is similar to the process shown in the above Figure 4 , and will not be repeated here.
[0175] Step S811: According to the average of the index values distributed on both sides of the step division line, draw a straight line corresponding to the average on both sides of the step division line, and draw a curve connecting the two straight lines;
[0176] Step S812: According to the index value corresponding to the intersection point of the drawn curve connecting the two straight lines and the actual division line and the preset abnormal tolerance, determine the abnormal boundary value on both sides of the step division line;
[0177] The preset abnormal tolerance can be set according to the needs, for example, the index value of the intersection point is increased or decreased by 0, 20%, 10%, etc.
[0178] Step S813: According to the abnormal boundary value, draw an abnormal boundary curve perpendicular to the other coordinate axis on both sides of the step division line;
[0179] Step S814: Determine that the abnormal boundary curve on each side of the step division line is the starting point, and the area of the corresponding straight line away from the side of the average is the abnormal area on the side;
[0180] The above steps S811 to S814 draw a straight line corresponding to the average, draw a curve connecting the two straight lines, construct an abnormal boundary curve, and an abnormal area, etc. Similar, will not be repeated here.
[0181] Step S815: From the plurality of index values included in the data sequence, filter out the abnormal index values in the abnormal area and the abnormal behaviors corresponding to the abnormal index values;
[0182] For example, the sales are too high, which may exist the abnormal behavior of brushing single, the sales are too low, which may need to adjust the marketing strategy, etc. By providing the abnormal index value, the user can find the existing problems and achieve operation monitoring and management.
[0183] Step S816: Push the abnormal index value and the abnormal behavior corresponding to the management end.
[0184] Figure 9 is a structural schematic diagram of a data processing device provided by an embodiment of the application. As shown in Figure 6 The data processing device 900 can include a receiving module 901, a data analysis module 902, and a pushing module 903, wherein
[0185] The receiving module 901 is configured to receive a data processing request, wherein the data processing request includes an index to be analyzed;
[0186] The data analysis module 902 is configured to: acquire a data sequence corresponding to an index to be analyzed, wherein the data sequence comprises index values corresponding to a plurality of time points of the index to be analyzed; divide the plurality of index values included in the data sequence into a plurality of array pairs, wherein each array pair has two complementary data groups, each data group is composed of an index value or a plurality of index values of continuously changing time points, all index values included in the two complementary data groups correspond to all index values included in the data sequence in a one-to-one manner, and the time points of the index values included in the two complementary data groups do not overlap; for each array pair, calculate an index loss of the array pair according to the index values included in the two complementary data groups of the array pair; determine a step division line of the data sequence according to the index losses of the plurality of array pairs; determine a target array pair with the minimum index loss according to the index losses of the plurality of array pairs; and determine an abnormal index value of each data group in the target array pair and an abnormal behavior corresponding to the abnormal index value, respectively.
[0187] The pushing module 903 is configured to push the abnormal index value and the abnormal behavior to a management end.
[0188] In the embodiment of the present application, the data analysis module 902 is further configured to, in a case where a data type included in the data processing request meets a preset data processing condition, perform the step of dividing the plurality of index values included in the data sequence into the plurality of array pairs.
[0189] In the embodiment of the present application, the data analysis module 902 is further configured to construct an initial division point between each two adjacent time points; and for each initial division point, divide the index values located on two sides of the initial division point into two complementary data groups to form an array pair.
[0190] In the embodiment of the present application, the data analysis module 902 is further configured to calculate an array mean of the two complementary data groups of the array pair; for each index value, calculate a variance of the index value relative to the array mean of the data group to which the index value belongs; and accumulate the variances corresponding to each index value to obtain the index loss of the array pair.
[0191] In the embodiment of the present application, the data analysis module 902 is further configured to: select an actual division point corresponding to the array pair with the minimum index loss from the plurality of initial division points, and determine a straight line passing through the actual division point as the step division line of the data sequence, wherein each point on the step division line corresponds to the time point of the actual division point, and the index values corresponding to the points on the step division line are all different; and determine abnormal index values distributed on two sides of the step division line according to the index values distributed on the two sides of the step division line, respectively.
[0192] In the embodiment of the present application, the data analysis module 902 is further configured to determine a middle point between each two adjacent time points as an initial segmentation point.
[0193] In the embodiment of the present application, the data analysis module 902 is further configured to divide an abnormal region on both sides of the ladder segmentation line according to the index values distributed on both sides of the ladder segmentation line; and filter out abnormal index values in the abnormal region from the plurality of index values included in the data sequence.
[0194] In the embodiment of the present application, the data analysis module 902 is further configured to draw a two-dimensional coordinate system, wherein one coordinate axis of the two-dimensional coordinate system corresponds to the time points in the data sequence, and the other coordinate axis corresponds to the to-be-analyzed index; draw a straight line corresponding to the mean value on both sides of the ladder segmentation line according to the mean value of the index values distributed on both sides of the ladder segmentation line, and draw a curve connecting the two straight lines; determine the abnormal boundary values on both sides of the ladder segmentation line according to the index values corresponding to the intersection points of the drawn curve connecting the two straight lines and the actual segmentation line and the preset abnormal tolerance; draw an abnormal boundary curve perpendicular to the other coordinate axis on both sides of the ladder segmentation line according to the abnormal boundary values; and determine the abnormal boundary curve on each side of the ladder segmentation line as a starting point, and determine the region of the straight line corresponding to the mean value away from the side as the abnormal region of the side.
[0195] In the embodiment of the present application, the data analysis module 902 is further configured to divide the data sequence into a plurality of data subsequences according to the data change parameters included in the data processing request, wherein each two adjacent data subsequences include a plurality of coincident time points and corresponding index values; and divide the plurality of index values included in each data subsequence into a plurality of array pairs.
[0196] Reference will be made to the following description of the embodiments of the present application with reference to the drawings. Figure 10 FIG. 1 shows a structural schematic diagram of a computer system 1000 suitable for implementing a terminal device or a server according to an embodiment of the present application. Figure 10 The terminal device or the server shown is merely an example and should not impose any limitation on the functions and use range of the embodiments of the present application.
[0197] As shown in FIG. 1, the computer system 1000 includes a central processing unit (CPU) 1001, a memory 1002, a storage device 1003, a keyboard 1004, a mouse 1005, a display device 1006, and a network interface 1007. Figure 10As shown, the computer system 1000 includes a central processing unit (CPU) 1001 which can perform various appropriate actions and processes in accordance with a program stored in a read only memory (ROM) 1002 or a program loaded from the storage section 1008 into a random access memory (RAM) 1003. In the RAM 1003, various programs and data required for the operation of the system 1000 are also stored. The CPU 1001, the ROM 1002, and the RAM 1003 are connected to each other through a bus 1004. An input / output (I / O) interface 1005 is also connected to the bus 1004.
[0198] Connected to the I / O interface 1005 are an input section 1006 including a keyboard, a mouse, etc.; an output section 1007 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1008 including a hard disk, etc.; and a communication section 1009 including a network interface card such as a LAN card, a modem, etc. The communication section 1009 performs communication processing via a network such as the Internet. A drive 1010 is also connected to the I / O interface 1005 as necessary. A removable recording medium 1011 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive 1010 as necessary, so that a computer program read therefrom is installed into the storage section 1008 as necessary.
[0199] In particular, the processes described above with reference to the flow charts can be implemented as a computer software program in accordance with the embodiments of the present disclosure. For example, the embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods shown in the flow charts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 1009, and / or installed from the removable recording medium 1011. When the computer program is executed by the central processing unit (CPU) 1001, the above-described functions defined in the system of the present disclosure are executed.
[0200] It should be noted that the computer-readable medium shown in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination of the above. More specific examples of computer-readable storage media can 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal or any suitable combination of the above. The computer-readable signal medium can also be any computer-readable medium other than the computer-readable storage medium, which can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained on the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0201] The flowcharts and block diagrams in the drawings illustrate the possible implementation architectures, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code containing one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur in different order than that shown in the drawings. For example, two blocks that are shown in succession can actually be executed substantially in parallel, and sometimes in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams or flowcharts, and the combination of blocks in the block diagrams or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.
[0202] The modules described in the embodiments of the present application can be implemented in the form of software or hardware. The described modules can also be arranged in a processor, for example, a processor can be described as including a receiving module, a data analysis module, and a pushing module. In some cases, the names of these modules do not constitute a limitation on the modules themselves, for example, the receiving module can also be described as a "module for receiving a data processing request".
[0203] As another aspect, the present application also provides a computer readable medium, which can be included in the device described in the above embodiments, or can exist independently without being assembled into the device. The computer readable medium carries one or more programs, when the one or more programs are executed by the device, the device includes: receiving a data processing request, wherein the data processing request includes an index to be analyzed; obtaining a data sequence corresponding to the index to be analyzed, wherein the data sequence includes index values of the index to be analyzed corresponding to a plurality of time points; dividing the plurality of index values included in the data sequence into a plurality of array pairs, each array pair having two complementary data groups, each data group being composed of an index value or a plurality of index values of consecutive time points, the two complementary data groups including all index values corresponding to all index values included in the data sequence, and the time points of the index values included in the two complementary data groups not overlapping; for each array pair, calculating the index loss of the array pair according to the index values included in the two complementary data groups of the array pair; determining a target array pair with the minimum index loss according to the index losses of the plurality of array pairs; determining an abnormal index value of each data group in the target array pair and an abnormal behavior corresponding to the abnormal index value; and pushing the abnormal index value and the abnormal behavior to the management end.
[0204] According to the technical scheme of the embodiment of the present application, by dividing the multiple index values included in the data sequence into multiple array pairs, each array pair has two complementary data groups, each data group is composed of an index value or multiple index values of time points in continuous change, all index values included in the two complementary data groups correspond to all index values included in the data sequence one by one, and the time points of the index values included in the two complementary data groups do not overlap, then by calculating the index loss of the array pair, the data sequence is segmented, that is, the target array pair with the minimum index loss is determined. Then according to the index values distributed on both sides of the step segmentation line, the abnormal index values of each data group in the target array pair and the abnormal behaviors corresponding to the abnormal index values are determined, that is, the data sequence is segmented, then the abnormal index values and the abnormal behaviors of each segment are determined, the step distribution data is analyzed in segments, the mutual interference of the data with large differences is avoided, and the accuracy of the data anomaly analysis is effectively improved, so that the abnormal behaviors related to the data anomaly can be accurately found.
[0205] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can occur depending on design requirements and other factors. Any modification, equivalent replacement and improvement within the spirit and principle of the present application should be included in the protection scope of the present application.
Claims
1. A data processing method, characterized by, The method comprises the following steps: receiving a data processing request, wherein the data processing request comprises an index to be analyzed; obtaining a data sequence corresponding to the index to be analyzed, wherein the data sequence comprises index values of the index to be analyzed corresponding to a plurality of time points; dividing the plurality of index values included in the data sequence into a plurality of array pairs, wherein each array pair has two complementary data groups, each data group is composed of an index value or a plurality of index values of consecutive time points, all index values included in the two complementary data groups correspond one-to-one to all index values included in the data sequence, and the time points of the index values included in the two complementary data groups do not overlap; for each array pair, calculating an index loss of the array pair according to the index values included in the two complementary data groups of the array pair; determining a target array pair with the minimum index loss from the index losses of the plurality of array pairs; determining an abnormal index value and an abnormal behavior corresponding to the abnormal index value of each data group in the target array pair, respectively; pushing the abnormal index value and the abnormal behavior to a management end correspondingly; the calculation of the index loss of the array pair comprises the following steps: calculating an array mean of the two complementary data groups of the array pair; for each index value, calculating a variance of the index value relative to the array mean of the data group to which the index value belongs; accumulating the variances corresponding to each index value to obtain the index loss of the array pair.
2. The data processing method of claim 1, wherein, The data processing request further comprises a data type; in the case that the data type meets a preset data processing condition, the step of dividing the plurality of index values included in the data sequence into a plurality of array pairs is performed.
3. The data processing method according to claim 1 or 2, characterized in that, The division of the plurality of index values included in the data sequence into a plurality of array pairs comprises the following steps: constructing an initial segmentation point between each adjacent two time points; for each initial segmentation point, dividing the index values located on both sides of the initial segmentation point into two complementary data groups to form an array pair.
4. The data processing method according to claim 3, characterized in that, The method further comprises the following steps: selecting an actual segmentation point corresponding to an array pair with the minimum index loss from the plurality of initial segmentation points, and determining a straight line passing through the actual segmentation point as a step segmentation line of the data sequence, wherein each point on the step segmentation line corresponds to the time point of the actual segmentation point, and the index values corresponding to the points on the step segmentation line are all different; the determination of the abnormal index value of each data group in the target array pair comprises the following steps: determining the abnormal index values distributed on both sides of the step segmentation line according to the index values distributed on both sides of the step segmentation line.
5. The data processing method according to claim 3, characterized in that, The construction of an initial segmentation point between each adjacent two time points comprises the following steps: determining the middle point of each adjacent two time points as an initial segmentation point.
6. The data processing method according to claim 4, characterized in that, The determination of the abnormal index value comprises the following steps: dividing an abnormal region on both sides of the step segmentation line according to the step segmentation line and the index values distributed on both sides of the step segmentation line; selecting an abnormal index value located in the abnormal region from the plurality of index values included in the data sequence.
7. The data processing method according to claim 6, characterized in that, The abnormal area is divided on both sides of the step dividing line, comprising: drawing a two-dimensional coordinate system, wherein one coordinate axis in the two-dimensional coordinate system corresponds to a time point in the data sequence, and the other coordinate axis corresponds to the to-be-analyzed index, and the step dividing line is parallel to the other coordinate axis; drawing a straight line corresponding to the mean value on both sides of the step dividing line according to the mean value of the index values distributed on both sides of the step dividing line, and drawing a curve connecting the two straight lines; determining the abnormal boundary value on both sides of the step dividing line according to the intersection point of the drawn curve connecting the two straight lines and the actual dividing line and the preset abnormal tolerance; drawing an abnormal boundary curve perpendicular to the other coordinate axis on both sides of the step dividing line according to the abnormal boundary value; determining the abnormal boundary curve on each side of the step dividing line as a starting point, and the area away from the corresponding mean value straight line on the side as the abnormal area on the side.
8. The data processing method of claim 1, wherein the data processing request further comprises a data change parameter; the data processing method further comprises: dividing the data sequence into a plurality of data subsequences according to the data change parameter, wherein each adjacent two data subsequences include a plurality of coincident time points and corresponding index values; the step of dividing the plurality of index values included in the data sequence into a plurality of array pairs comprises: dividing the plurality of index values included in each data subsequence into a plurality of array pairs.
9. A data processing apparatus, characterized by comprising: a receiving module, a data analysis module, and a pushing module, wherein the receiving module is configured to receive a data processing request, wherein the data processing request comprises a to-be-analyzed index; the data analysis module is configured to obtain a data sequence corresponding to the to-be-analyzed index, wherein the data sequence includes index values of the to-be-analyzed index corresponding to a plurality of time points; divide the plurality of index values included in the data sequence into a plurality of array pairs, wherein each array pair has two complementary data groups, each data group is composed of an index value or a plurality of continuously changed index values of time points, all index values included in the two complementary data groups correspond one-to-one to all index values included in the data sequence, and the time points of the index values included in the two complementary data groups do not overlap; for each array pair, calculate the index loss of the array pair according to the index values included in the two complementary data groups of the array pair; determine a step dividing line of the data sequence according to the index losses of a plurality of array pairs; determine a target array pair with the minimum index loss according to the index losses of a plurality of array pairs; determine an abnormal index value of each data group in the target array pair and an abnormal behavior corresponding to the abnormal index value, respectively; the pushing module is configured to push the abnormal index value and the abnormal behavior to a management end correspondingly. The data analysis module is further configured to calculate array mean of two complementary data groups that the array pair has; for each of the index values, calculate variance of the index value relative to array mean of the data group to which the index value belongs; and accumulate the variance corresponding to each of the index values to obtain index loss of the array pair.
10. An electronic device, comprising: comprising: one or more processors; a memory device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1-8.
11. A computer readable medium having stored thereon a computer program, characterized in that The program, when executed by a processor, implements the method according to any one of claims 1-8.
Citation Information
Patent Citations
Power consumer electricity utilization characteristic extraction method and system and terminal equipment
CN109492048A
Intention identification method and electronic device
WO2021180062A1