Method and device for detecting abnormality of mapping relationship between sorting and weighing
By analyzing the image identification information of dynamic weighing scales, high-frequency sorting line identifiers are identified and mapping relationships are detected, solving the problem of low efficiency in existing technologies and achieving more efficient and accurate anomaly detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SF TECH CO LTD
- Filing Date
- 2021-12-16
- Publication Date
- 2026-06-16
AI Technical Summary
Existing methods for detecting anomalies in the sorting and weighing mapping relationship are inefficient and cannot detect anomalies in the mapping relationship between dynamic scale operator number and sorting line identifier in a timely manner.
By acquiring multiple image identifiers corresponding to the target dynamic scale worker number, multiple sorting line identifiers are parsed out, and sorting line identifiers that appear more frequently than a preset frequency are identified as target sorting line identifiers. Anomaly detection is performed based on the mapping relationship between the target dynamic scale worker number and the sorting line identifiers, and anomaly detection results are generated.
It improves the efficiency and accuracy of anomaly detection in sorting and weighing mapping relationships, and can quickly determine whether the mapping relationship is abnormal.
Smart Images

Figure CN116266384B_ABST
Abstract
Description
Technical Field
[0001] This application mainly relates to the field of logistics technology, specifically to an anomaly detection method and device for sorting and weighing mapping relationships. Background Technology
[0002] Dynamic scales, based on dynamic weighing technology, automatically transport products "in motion" to the weighing platform for weighing and automatically classify and reject them. In the context of "science and technology being the primary productive force," dynamic scales, with their advantages of full automation, high precision, simple operation and maintenance, and comprehensive functions, provide the best choice for industries such as food, pharmaceuticals, chemicals, and logistics to ensure quality, reduce costs, and improve production efficiency.
[0003] In logistics sorting systems, dynamic scales are typically installed on sorting lines to weigh passing waybills. To manage the risk of under-weighting due to irregularities or malicious actions, current technology relies on the following approach: when the mapping between the dynamic scale's operator ID and the sorting line identifier changes, the system waits for a model in a certain area to consistently fail to obtain images of the sorting line, or when indicators in later stages decline, to deduce the problem and report it to maintenance. Maintenance personnel then contact the site equipment management personnel to confirm the information and manually modify the mapping. However, this approach of waiting for indicators in later stages to decline and manual investigation is too slow and cannot promptly detect anomalies in the mapping between the dynamic scale's operator ID and the sorting line identifier.
[0004] In other words, the existing methods for detecting anomalies in the sorting and weighing mapping relationship are inefficient. Summary of the Invention
[0005] This application provides a method and apparatus for detecting anomalies in sorting and weighing mapping relationships, aiming to solve the problem of low efficiency in existing methods for detecting anomalies in sorting and weighing mapping relationships.
[0006] Firstly, this application provides an anomaly detection method for sorting and weighing mapping relationships, the anomaly detection method for sorting and weighing mapping relationships comprising:
[0007] Obtain multiple first image identification information corresponding to the target dynamic weighing scale operator number, wherein the first image identification information includes the target dynamic weighing scale operator number;
[0008] The identification information of each of the first images is parsed to obtain multiple sorting line identifiers;
[0009] The sorting line identifiers that appear more frequently than a preset frequency among the multiple sorting line identifiers are identified as the target sorting line identifiers corresponding to the target dynamic weigher number.
[0010] Anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target dynamic weigher number and the target sorting line identifier, and the anomaly detection result is obtained.
[0011] Optionally, the step of parsing the identification information of each of the first images to obtain multiple sorting line identifiers includes:
[0012] Obtain the target tracking number;
[0013] Based on the target waybill number, the plurality of first image identification information is filtered to obtain a plurality of second image identification information, wherein the second image identification information includes the target waybill number;
[0014] The identification information of each of the second images is parsed to obtain multiple sorting line identifiers.
[0015] Optionally, the step of parsing the identification information of each of the second images to obtain multiple sorting line identifiers includes:
[0016] Obtain the weighing time of the target waybill by the target dynamic weigher ID and the image upload time of the multiple second image identification information;
[0017] Based on the weighing time and the image upload time, the plurality of second image identification information is filtered to obtain a plurality of third image identification information, wherein the time difference between the image upload time of the third image identification information and the weighing time of the target dynamic scale operator number is less than a preset time difference;
[0018] The identification information of each of the third images is parsed to obtain multiple sorting line identifiers.
[0019] Optionally, the step of parsing the identification information of each of the third images to obtain multiple sorting line identifiers includes:
[0020] Obtain the name string of the third image identification information;
[0021] Based on the target waybill number, perform string matching on the name string to obtain the target waybill number position in the name string;
[0022] The sorting line identifier position in the name string is determined based on the target waybill number position and the pre-stored position correspondence.
[0023] The sorting line identifier is obtained by extracting characters from the name string based on the sorting line identifier position.
[0024] Optionally, determining the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among the plurality of sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weigher number includes:
[0025] Obtain the frequency of occurrence of each sorting line identifier;
[0026] If at least two sorting line identifiers have an occurrence frequency higher than the preset occurrence frequency, then the sorting line identifier with the highest occurrence frequency among all sorting line identifiers is determined as the target sorting line identifier corresponding to the target dynamic weigher number.
[0027] Optionally, the step of performing anomaly detection on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher ID and the target sorting line identifier, and obtaining the anomaly detection result, includes:
[0028] Obtain the target weighing site corresponding to the target dynamic scale operator number;
[0029] Obtain the common features of the sorting line markers in the target weighing area;
[0030] Determine whether the target sorting line identifier matches the common features of the sorting line identifier;
[0031] If the target sorting line identifier matches the common feature of the sorting line identifier, then anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and anomaly detection results are obtained.
[0032] Optionally, obtaining the common features of the sorting line identifiers in the target weighing area includes:
[0033] Obtain the candidate dynamic scale operator numbers of multiple dynamic scales in the target weighing site;
[0034] Each candidate dynamic weigher number is identified as a candidate sorting line identifier, resulting in multiple candidate sorting line identifiers.
[0035] String matching is performed on any two candidate sorting line identifiers to obtain multiple matching keywords, wherein the matching keyword is the longest continuous string that is common to the two candidate sorting line identifiers;
[0036] The most frequently occurring matching keyword among the multiple matching keywords is determined as the common feature of the sorting line identifier.
[0037] Secondly, this application provides an anomaly detection device for sorting and weighing mapping relationships, the anomaly detection device for sorting and weighing mapping relationships comprising:
[0038] The acquisition unit is used to acquire multiple first image identification information corresponding to the target dynamic weighing scale operator number, wherein the first image identification information includes the target dynamic weighing scale operator number;
[0039] The parsing unit is used to parse the identification information of each of the first images to obtain multiple sorting line identifiers;
[0040] The determining unit is used to determine the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among the plurality of sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weigher number.
[0041] An anomaly detection unit is used to perform anomaly detection on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and obtain the anomaly detection result.
[0042] Optionally, the parsing unit is used for:
[0043] Obtain the target tracking number;
[0044] Based on the target waybill number, the plurality of first image identification information is filtered to obtain a plurality of second image identification information, wherein the second image identification information includes the target waybill number;
[0045] The identification information of each of the second images is parsed to obtain multiple sorting line identifiers.
[0046] Optionally, the parsing unit is used for:
[0047] Obtain the weighing time of the target waybill by the target dynamic weigher ID and the image upload time of the multiple second image identification information;
[0048] Based on the weighing time and the image upload time, the plurality of second image identification information is filtered to obtain a plurality of third image identification information, wherein the time difference between the image upload time of the third image identification information and the weighing time of the target dynamic scale operator number is less than a preset time difference;
[0049] The identification information of each of the third images is parsed to obtain multiple sorting line identifiers.
[0050] Optionally, the parsing unit is used for:
[0051] Obtain the name string of the third image identification information;
[0052] Based on the target waybill number, perform string matching on the name string to obtain the target waybill number position in the name string;
[0053] The sorting line identifier position in the name string is determined based on the target waybill number position and the pre-stored position correspondence.
[0054] The sorting line identifier is obtained by extracting characters from the name string based on the sorting line identifier position.
[0055] Optionally, the determining unit is configured to:
[0056] Obtain the frequency of occurrence of each sorting line identifier;
[0057] If at least two sorting line identifiers have an occurrence frequency higher than the preset occurrence frequency, then the sorting line identifier with the highest occurrence frequency among all sorting line identifiers is determined as the target sorting line identifier corresponding to the target dynamic weigher number.
[0058] Optionally, the anomaly detection unit is used for:
[0059] Obtain the target weighing site corresponding to the target dynamic scale operator number;
[0060] Obtain the common features of the sorting line markers in the target weighing area;
[0061] Determine whether the target sorting line identifier matches the common features of the sorting line identifier;
[0062] If the target sorting line identifier matches the common feature of the sorting line identifier, then anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and anomaly detection results are obtained.
[0063] Optionally, the anomaly detection unit is used for:
[0064] Obtain the candidate dynamic scale operator numbers of multiple dynamic scales in the target weighing site;
[0065] Each candidate dynamic weigher number is identified as a candidate sorting line identifier, resulting in multiple candidate sorting line identifiers.
[0066] String matching is performed on any two candidate sorting line identifiers to obtain multiple matching keywords, wherein the matching keyword is the longest continuous string that is common to the two candidate sorting line identifiers;
[0067] The most frequently occurring matching keyword among the multiple matching keywords is determined as the common feature of the sorting line identifier.
[0068] Thirdly, this application provides a computer device, the computer device comprising:
[0069] One or more processors;
[0070] Memory; and
[0071] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the anomaly detection method for the sorting and weighing mapping relationship as described in any one aspect.
[0072] Fourthly, this application provides a computer-readable storage medium storing a plurality of instructions adapted for loading by a processor to perform the steps in the anomaly detection method for the sorting and weighing mapping relationship as described in any one of the first aspects.
[0073] This application provides an anomaly detection method and apparatus for sorting and weighing mapping relationships. The anomaly detection method includes: acquiring multiple first image identifier information corresponding to a target dynamic weighing operator number, wherein the first image identifier information includes the target dynamic weighing operator number; parsing each first image identifier information to obtain multiple sorting line identifiers; determining the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among the multiple sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weighing operator number; and performing anomaly detection on a pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weighing operator number and the target sorting line identifier to obtain an anomaly detection result. This application first obtains multiple first image identifiers corresponding to the target dynamic weighing operator number, then parses multiple sorting line identifiers from these identifiers. A target mapping relationship is established between the frequently occurring sorting line identifiers and the target dynamic weighing operator number. The newly generated target mapping relationship is then used to detect whether the old pre-stored sorting and weighing mapping relationship is abnormal. This allows for rapid determination of whether the old pre-stored sorting and weighing mapping relationship is abnormal, improving the efficiency of anomaly detection. Simultaneously, establishing a target mapping relationship between the frequently occurring sorting line identifiers and the target dynamic weighing operator number, and using a voting method among multiple sorting line identifiers to determine the target sorting line identifier corresponding to the target dynamic weighing operator number, can improve the accuracy of anomaly detection in the sorting and weighing mapping relationship. Attached Figure Description
[0074] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 This is a schematic diagram of a scenario for an anomaly detection system for sorting and weighing mapping relationships provided in an embodiment of this application;
[0076] Figure 2 This is a schematic flowchart of an embodiment of the anomaly detection method for sorting and weighing mapping relationships provided in this application.
[0077] Figure 3 This is a schematic diagram of an embodiment of the anomaly detection device for the sorting and weighing mapping relationship provided in this application.
[0078] Figure 4 This is a schematic diagram of an embodiment of the computer device provided in this application. Detailed Implementation
[0079] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0080] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are used only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this application. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more features. In the description of this application, "a plurality of" means two or more, unless otherwise explicitly specified.
[0081] In this application, the term "exemplary" is used to mean "used as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use this application. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that this application can be made without using these specific details. In other instances, well-known structures and processes are not described in detail to avoid obscuring the description of this application with unnecessary detail. Therefore, this application is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0082] This application provides an anomaly detection method and apparatus for sorting and weighing mapping relationships, which will be described in detail below.
[0083] Please see Figure 1 , Figure 1 This is a schematic diagram of a scenario for an anomaly detection system for sorting and weighing mapping relationships provided in an embodiment of this application. The anomaly detection system for sorting and weighing mapping relationships may include a computer device 100, which integrates an anomaly detection device for sorting and weighing mapping relationships.
[0084] In this embodiment, the computer device 100 can be a standalone server, a server network, or a server cluster. For example, the computer device 100 described in this embodiment includes, but is not limited to, a computer, a network host, a single network server, a set of multiple network servers, or a cloud server composed of multiple servers. The cloud server is composed of a large number of computers or network servers based on cloud computing.
[0085] In this embodiment, the computer device 100 described above can be a general-purpose computer device or a special-purpose computer device. In specific implementations, the computer device 100 can be a desktop computer, a portable computer, a network server, a handheld computer (Personal Digital Assistant, PDA), a mobile phone, a tablet computer, a wireless terminal device, a communication device, an embedded device, etc. This embodiment does not limit the type of computer device 100.
[0086] Those skilled in the art will understand that Figure 1 The application environment shown is merely one application scenario of the solution in this application and does not constitute a limitation on the application scenario of the solution in this application. Other application environments may include more than one application scenario. Figure 1 The number of computer devices shown is more or less, for example Figure 1Only one computer device is shown in the diagram. It is understood that the anomaly detection system for the sorting and weighing mapping relationship may also include one or more other computer devices capable of processing data, which are not specifically limited here.
[0087] In addition, such as Figure 1 As shown, the anomaly detection system for the sorting and weighing mapping relationship may also include a memory 200 for storing data.
[0088] It should be noted that, Figure 1 The schematic diagram of the abnormal detection system for the sorting and weighing mapping relationship shown is merely an example. The abnormal detection system and scenario for the sorting and weighing mapping relationship described in this application are for the purpose of more clearly illustrating the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of the abnormal detection system for the sorting and weighing mapping relationship and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.
[0089] Automated freight collection across the entire supply chain has been achieved through AI visual analysis and big data risk identification, with the re-weighing result of the dynamic scale being a crucial indicator. To ensure the accuracy and reliability of the weighing results, a visual AI model is needed to determine whether there is only one package on the scale. The AI model is configured at the edge of the site and requires the industrial control computer corresponding to each sorting line to obtain images of the waybill numbers passing through the dynamic scale equipment. After the model's judgment, the results and the corresponding dynamic scale worker numbers for each waybill are reported. The sorting line identifier affects whether the AI model can obtain the corresponding image, while the worker number affects subsequent processing after reporting. Therefore, the mapping relationship between the sorting line identifier and the dynamic scale worker number is critical. The current problem is that neither the sorting line identifier nor the dynamic scale worker number is a unique fixed value. Both can change due to uncertainties such as site modifications and the addition of new equipment, causing variations in the sorting and weighing mapping relationship between the dynamic scale worker number and the sorting line identifier.
[0090] First, this application provides an anomaly detection method for sorting and weighing mapping relationships. The anomaly detection method for sorting and weighing mapping relationships includes: obtaining multiple first image identifier information corresponding to a target dynamic scale worker number, wherein the first image identifier information includes the target dynamic scale worker number; parsing each first image identifier information to obtain multiple sorting line identifiers; determining the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among the multiple sorting line identifiers as the target sorting line identifier corresponding to the target dynamic scale worker number; and performing anomaly detection on the pre-stored sorting and weighing mapping relationship according to the target mapping relationship between the target dynamic scale worker number and the target sorting line identifier to obtain anomaly detection results.
[0091] like Figure 2 As shown, Figure 2 This is a schematic flowchart of an embodiment of the anomaly detection method for sorting and weighing mapping relationships in this application. The anomaly detection method for sorting and weighing mapping relationships includes the following steps S201 to S204:
[0092] S201. Obtain multiple first image identification information corresponding to the target dynamic scale worker number.
[0093] The first image identification information includes the target dynamic scale's operator number. The target dynamic scale can be any dynamic scale in the anomaly detection system of this sorting and weighing mapping relationship. Multiple dynamic scales each have their own operator number; therefore, the anomaly detection device for the sorting and weighing mapping relationship can track and record the data of the target dynamic scale based on the operator number. Of course, the dynamic scale's weighing anomaly detection device can simultaneously track multiple different target dynamic scales. Since the anomaly detection method for each dynamic scale is the same in the sorting and weighing mapping relationship anomaly detection device, this application only uses the anomaly detection method for a single target dynamic scale as an example for explanation.
[0094] As the waybill moves along the sorting line and is weighed by the dynamic scale, the camera in the sorting-weighing mapping anomaly detection system scans the waybill from six sides at a preset frequency, obtaining multiple images and naming them to generate multiple image naming information. The sorting line is typically a conveyor belt. The image naming information may include fields such as image upload time, location, sorting line identifier, waybill number, and image name. Additionally, the dynamic scale acquires weighing information during the weighing process, including the waybill number, location, dynamic scale operator number, and weighing time.
[0095] Furthermore, multiple image naming information and multiple weighing information within a preset historical time period are obtained. The weighing information is then linked and merged with the image naming information based on the waybill number and the location to obtain the fourth image identification information. The preset historical time period can be one month, half a month, one day, etc., and can be set according to specific circumstances. Specifically, weighing information and image naming information with the same waybill number and the same location are linked and merged to obtain the image identification information. For example, the image naming information might be: image upload time 17:25; location A1; sorting line identifier B1; waybill number C1; image name D1. The weighing information might be: waybill number C1; location A1; dynamic scale operator number E1; weighing time 17:30, etc. Since both the weighing information and the image naming information are for site A1 and waybill number C1, the weighing information and image naming information are linked and merged to obtain the fourth image identification information as follows: image upload time 17:25; site A1; sorting line identifier B1; waybill number C1; image name D1; dynamic scale operator number E1; weighing time 17:30. Waybill numbers and sites that are not linked can be filtered out, retaining the remaining data.
[0096] In this embodiment, after obtaining multiple fourth image identification information, multiple first image identification information corresponding to the target dynamic weighing operator number is obtained from the multiple fourth image identification information. The first image identification information includes the target dynamic weighing operator number. Since the multiple fourth image identification information is information for all dynamic weighing operator numbers, the multiple first image identification information corresponding to the target dynamic weighing operator number can be obtained based on the target dynamic weighing operator number.
[0097] S202. The identification information of each first image is parsed to obtain multiple sorting line identifiers.
[0098] In this embodiment of the application, the identification information of each first image is parsed to obtain multiple sorting line identifiers, which may include:
[0099] (1) Obtain the target tracking number.
[0100] In this embodiment, the target waybill number can be any order number in the first image identification information. For example, the target waybill number is E1. Preferably, the target waybill number is the waybill number that appears most frequently in the first image identification information. The fact that the target waybill number is the most frequently appearing waybill number among multiple first image identification information indicates that the waybill corresponding to the target waybill number has been photographed the most, resulting in the most images. This avoids obtaining too few image names, thereby improving the accuracy of subsequent calculations.
[0101] (2) Based on the target waybill number, multiple first image identification information is filtered to obtain multiple second image identification information, wherein the second image identification information includes the target waybill number.
[0102] (3) Parse the identification information of each second image to obtain multiple sorting line identifiers.
[0103] In a specific embodiment, each second image identification information is parsed to obtain multiple sorting line identifiers, which may include:
[0104] (1) Obtain the weighing time of the target dynamic weighing scale operator number for weighing the target waybill and the image upload time of multiple second image identification information.
[0105] For example, the weighing time for the target dynamic scale operator to weigh the target waybill is 17:30, and the image upload times for multiple second image identification information are 17:13, 17:23, 17:30, 17:32, and 17:35, respectively.
[0106] (2) Based on the weighing time and the image upload time, multiple second image identification information is filtered to obtain multiple third image identification information. Among them, the time difference between the image upload time of the third image identification information and the weighing time of the target dynamic scale number is less than the preset time difference.
[0107] In this embodiment, the preset time difference can be set according to specific parameters, for example, a preset time difference of 10 minutes. In a specific embodiment, a pre-stored sorting and weighing mapping relationship is obtained, and the pre-stored sorting line identifier corresponding to the target dynamic scale worker number is determined based on the pre-stored sorting and weighing mapping relationship and the target dynamic scale worker number. The average transmission speed and line length of the sorting line corresponding to the pre-stored sorting line identifier are obtained, and the preset time difference is determined based on the average transmission speed and line length. For example, in the pre-stored sorting and weighing mapping relationship, the target waybill number E1 corresponds to the pre-stored sorting line identifier B2. The average rotation speed of the pre-stored sorting line identifier B2 is 0.5 m / s and the line length is 30 m. Then, the preset time difference is 60 s, that is, the preset time difference is the time it takes for the waybill to move from one end of the pre-stored sorting line to the other end. Since the target dynamic scale may be located at any position on the sorting line, the time difference between the image upload time of the third image identification information and the weighing time of the target dynamic scale's work number is less than the preset time difference. This can exclude images of the target waybill on other lines as much as possible, avoid interference, and improve the accuracy of abnormal detection of the sorting and weighing mapping relationship.
[0108] (3) Parse the identification information of each third image to obtain multiple sorting line identifiers.
[0109] In one specific embodiment, the identification information of each third image is parsed to obtain multiple sorting line identifiers, including:
[0110] (1) Obtain the name string of the third image identifier information.
[0111] For example, the third image identification information is as follows: image upload time 17:25; site A1; sorting line identifier B1; waybill number C1; image name D1; dynamic scale operator number E1; weighing time 17:30. The name string of the third image identification information is: 1725_C1_A1_D1_E1_B1_1730. Where C1 is the target waybill number.
[0112] (2) Perform string matching on the name string based on the target waybill number to obtain the position of the target waybill number in the name string.
[0113] String matching is a frequently used operation: given a text of length N and a pattern string of length M (N≥M), find a substring in the text that matches the pattern string. This problem can be extended to more complex problems such as counting the occurrences of the pattern string in the text and identifying the context (text surrounding the substring that matches the pattern string). Algorithms such as the Brute-Force algorithm and the Knuth-Morris-Pratt algorithm can be used to perform string matching based on the target tracking number in the name string, thus determining the position of the target tracking number within the name string.
[0114] The Brute-Force algorithm is a brute-force search that checks for a match at any position in the text that might match the pattern string. One pointer `i` tracks the text, and another pointer `j` tracks the pattern string. For each `i`, a match search is initiated; if the pattern matches, `i` is returned; otherwise, `j` is reset to 0, and `i` is moved to the next position for the next match. In some string matching scenarios, the text string contains many substrings that are similar to but not identical to the pattern string. For example, searching for `aab` in `aaaaaaaaaaaaaab`. Using the Brute-Force algorithm, every time a mismatch occurs, the text string pointer `i` must backtrack to the position after the start of the previous match and start again. This effectively performs multiple comparisons of characters between `i` and `i+j`, resulting in a lot of redundant work. In reality, the text string pointer `i` doesn't need to backtrack; only the pattern string pointer `j` needs to backtrack. The goal of the Knuth-Morris-Pratt algorithm is to eliminate this meaningless repetitive work. It minimizes the backtracking of the pattern string pointer `j` because characters that have already been matched in a previous mismatch might be used in the next match.
[0115] (3) Determine the sorting line identifier position in the name string based on the correspondence between the target waybill number position and the pre-stored position.
[0116] The pre-stored position correspondence is the position correspondence between the waybill number and the sorting line identifier. For example, the pre-stored position correspondence is: the sorting line identifier in the name string is the 20th to 10th characters before the waybill number. It can be set according to the specific situation.
[0117] Since waybill numbers generally follow a pattern, string matching of waybill numbers makes it easy to determine their location. However, sorting line identifier codes are more irregular, making direct determination difficult. Therefore, using the waybill number as a reference to determine the sorting line identifier's location allows for quick identification even when the code is irregular.
[0118] (4) Extract characters from the name string based on the sorting line identifier position to obtain the sorting line identifier.
[0119] It should be noted that parsing each first image identifier information separately yields multiple sorting line identifiers, which may include: obtaining the name string of the first image identifier information; performing string matching on the name string based on the target waybill number to obtain the target waybill number position in the name string; determining the sorting line identifier position in the name string based on the target waybill number position and the pre-stored position correspondence; and extracting characters from the name string based on the sorting line identifier position to obtain the sorting line identifier.
[0120] Each second image identifier is parsed to obtain multiple sorting line identifiers. This process may include: obtaining the name string of the second image identifier; performing string matching on the name string based on the target waybill number to obtain the position of the target waybill number in the name string; determining the position of the sorting line identifier in the name string based on the target waybill number position and the pre-stored position correspondence; and extracting characters from the name string based on the sorting line identifier position to obtain the sorting line identifier.
[0121] S203. The sorting line identifier with a frequency higher than the preset frequency among multiple sorting line identifiers is identified as the target sorting line identifier corresponding to the target dynamic weigher number.
[0122] In one specific embodiment, determining the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among multiple sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weigher number may include:
[0123] (1) Obtain the frequency of occurrence of each sorting line identifier.
[0124] In one specific embodiment, the frequency of each sorting line identifier is the ratio of the frequency of each sorting line identifier to the total number of sorting line identifiers. For example, if there are a total of 10 first image identifiers, resulting in 10 corresponding sorting line identifiers: Sorting line A1, Sorting line A1, Sorting line A2, Sorting line A2, Sorting line A3, Sorting line A3, Sorting line A3, Sorting line A3, Sorting line A3. Then, the frequency of sorting line A1 is 2 times; the frequency of sorting line A2 is 2 times; and the frequency of sorting line A3 is 6 times. The frequencies of each sorting line identifier are 0.2, 0.2, and 0.6, respectively.
[0125] (2) If at least two sorting line identifiers have a higher frequency of occurrence than the preset frequency, then the sorting line identifier with the highest frequency of occurrence among all sorting line identifiers shall be determined as the target sorting line identifier corresponding to the target dynamic weigher number.
[0126] The sorting line identifier that appears most frequently is most likely the target sorting line identifier corresponding to the target dynamic weighing operator number. Therefore, the sorting line identifier that appears most frequently is determined to be the target sorting line identifier corresponding to the target dynamic weighing operator number. Of course, a target dynamic weighing operator number can correspond to multiple target sorting line identifiers, and multiple target dynamic weighing operator numbers can also correspond to one target sorting line identifier. This application does not limit this.
[0127] S204. Based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, perform anomaly detection on the pre-stored sorting and weighing mapping relationship to obtain the anomaly detection result.
[0128] In this embodiment of the application, the anomaly detection of the pre-stored sorting and weighing mapping relationship is performed based on the target mapping relationship between the target dynamic weigher ID and the target sorting line identifier, and the anomaly detection result is obtained, which may include:
[0129] (1) Obtain the target weighing site corresponding to the target dynamic scale operator number.
[0130] The target weighing area is the location of the target dynamic scale.
[0131] (2) Obtain the common features of the sorting line markings in the target weighing area.
[0132] In one specific embodiment, obtaining the common features of sorting line identifiers in the target weighing area includes: obtaining candidate dynamic scale operator numbers of multiple dynamic scales in the target weighing area; determining the candidate sorting line identifiers corresponding to each candidate dynamic scale operator number, thus obtaining multiple candidate sorting line identifiers; performing string matching on any two candidate sorting line identifiers to obtain multiple matching keywords, wherein the matching keyword is the longest continuous string common to the two candidate sorting line identifiers; and determining the matching keyword with the highest frequency among the multiple matching keywords as the common feature of the sorting line identifiers. For example, if the string of one sorting line identifier is abfcgdlme and the string of another sorting line identifier is bafcgdlxe, then the matching keyword is fcgdl.
[0133] Specifically, multiple fifth-image identifiers corresponding to candidate dynamic weighing scale worker numbers are obtained. These fifth-image identifiers include the candidate dynamic weighing scale worker numbers. Each fifth-image identifier is parsed to obtain multiple sorting line identifiers. The sorting line identifiers whose frequency of occurrence is higher than a preset frequency are identified as the candidate sorting line identifiers corresponding to the candidate dynamic weighing scale worker numbers. That is, the method for obtaining candidate sorting line identifiers based on candidate dynamic weighing scale worker numbers is the same as the method for obtaining target sorting line identifiers based on target dynamic weighing scale worker numbers. For example, with 10 candidate sorting line identifiers, there are 45 matching keywords. The matching keyword with the highest frequency among these is identified as the common feature of the sorting line identifiers. The highest frequency of a matching keyword indicates that it best represents the common feature of the sorting line identifiers.
[0134] (3) Determine whether the target sorting line identifier matches the common features of the sorting line identifier.
[0135] Specifically, the system determines whether the target sorting line identifier contains common features of sorting line identifiers. If the target sorting line identifier contains common features, then the target sorting line identifier is considered to match the common features of sorting line identifiers. If the target sorting line identifier does not contain common features of sorting line identifiers, it indicates that the target mapping relationship between the target dynamic weigher ID and the target sorting line identifier is likely a misjudgment. This may be due to a delay in the uploaded weighing time or a low six-sided scanning recognition rate on the line, and therefore cannot be used for anomaly detection.
[0136] (4) If the target sorting line identifier matches the common feature of the sorting line identifier, then perform anomaly detection on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and obtain the anomaly detection result.
[0137] In this embodiment of the application, if the target sorting line identifier matches the common features of the sorting line identifier, the target sorting line identifier does indeed belong to the site where the target dynamic scale is located, and the target mapping relationship between the target dynamic scale employee number and the target sorting line identifier is determined to be correct, it can be used for anomaly detection.
[0138] Specifically, it determines whether the target mapping relationship matches the pre-stored sorting and weighing mapping relationship. If the target mapping relationship does not match the pre-stored sorting and weighing mapping relationship, the anomaly detection result is determined to be an abnormal mapping relationship, and the original pre-stored sorting and weighing mapping relationship is changed according to the target mapping relationship. Of course, the target mapping relationship and the pre-stored sorting and weighing mapping relationship can also be sent to the staff for confirmation.
[0139] This application first obtains multiple first image identifiers corresponding to the target dynamic weighing operator number, then parses multiple sorting line identifiers from these identifiers. A target mapping relationship is established between the frequently occurring sorting line identifiers and the target dynamic weighing operator number. The newly generated target mapping relationship is then used to detect whether the old pre-stored sorting and weighing mapping relationship is abnormal. This allows for rapid determination of whether the old pre-stored sorting and weighing mapping relationship is abnormal, improving the efficiency of anomaly detection. Simultaneously, establishing a target mapping relationship between the frequently occurring sorting line identifiers and the target dynamic weighing operator number, and using a voting method among multiple sorting line identifiers to determine the target sorting line identifier corresponding to the target dynamic weighing operator number, can improve the accuracy of anomaly detection.
[0140] To better implement the anomaly detection method for sorting and weighing mapping relationships in the embodiments of this application, an anomaly detection device for sorting and weighing mapping relationships is also provided in the embodiments of this application, such as... Figure 3 As shown, the anomaly detection device 300 for sorting and weighing mapping includes:
[0141] The acquisition unit 301 is used to acquire multiple first image identification information corresponding to the target dynamic weighing scale operator number, wherein the first image identification information includes the target dynamic weighing scale operator number;
[0142] The parsing unit 302 is used to parse the identification information of each first image to obtain multiple sorting line identifiers;
[0143] The determining unit 303 is used to determine the sorting line identifier with a higher frequency of occurrence than a preset frequency among multiple sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weigher number.
[0144] The anomaly detection unit 304 is used to perform anomaly detection on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and obtain the anomaly detection result.
[0145] Optionally, the parsing unit 302 is used for:
[0146] Obtain the target tracking number;
[0147] Based on the target waybill number, multiple first image identification information is filtered to obtain multiple second image identification information, wherein the second image identification information includes the target waybill number;
[0148] The identification information of each second image is parsed to obtain multiple sorting line identifiers.
[0149] Optionally, the parsing unit 302 is used for:
[0150] Obtain the target dynamic weighing scale operator ID, the weighing time of the target waybill, and the image upload time of multiple second image identification information;
[0151] Multiple second image identifiers are filtered based on weighing time and image upload time to obtain multiple third image identifiers. Among them, the time difference between the image upload time of the third image identifier and the weighing time of the target dynamic scale operator is less than the preset time difference.
[0152] The identification information of each third image is parsed to obtain multiple sorting line identifiers.
[0153] Optionally, the parsing unit 302 is used for:
[0154] Retrieve the name string of the third image identifier;
[0155] Based on the target waybill number, perform string matching on the name string to obtain the position of the target waybill number in the name string;
[0156] The sorting line identifier position in the name string is determined based on the correspondence between the target waybill number position and the pre-stored position;
[0157] The sorting line identifier is obtained by extracting characters from the name string based on the sorting line identifier position.
[0158] Optionally, determining unit 303 is used for:
[0159] Obtain the frequency of occurrence of each sorting line identifier;
[0160] If at least two sorting line identifiers have an occurrence frequency higher than the preset occurrence frequency, then the sorting line identifier with the highest occurrence frequency among all sorting line identifiers will be determined as the target sorting line identifier corresponding to the target dynamic weigher number.
[0161] Optionally, the anomaly detection unit 304 is used for:
[0162] Obtain the target weighing site corresponding to the target dynamic scale operator number;
[0163] Obtain common features of the sorting line markers in the target weighing area;
[0164] Determine whether the target sorting line identifier matches the common features of the sorting line identifier;
[0165] If the target sorting line identifier matches the common features of the sorting line identifier, then anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and the anomaly detection result is obtained.
[0166] Optionally, the anomaly detection unit 304 is used for:
[0167] Obtain the candidate dynamic scale operator numbers of multiple dynamic scales in the target weighing site;
[0168] Each candidate dynamic weigher number is identified as a candidate sorting line identifier, resulting in multiple candidate sorting line identifiers.
[0169] Perform string matching on any two candidate sorting line identifiers to obtain multiple matching keywords. The matching keyword is the longest continuous string that is common to the two candidate sorting line identifiers.
[0170] The most frequently occurring matching keyword among multiple matching keywords is identified as the common feature of the sorting line identifier.
[0171] This application also provides a computer device that integrates any of the sorting and weighing mapping relationship anomaly detection devices provided in this application. The computer device includes:
[0172] One or more processors;
[0173] Memory; and
[0174] One or more applications, wherein the applications are stored in memory and configured to be executed by a processor in the steps of the anomaly detection method for sorting and weighing mapping relationships in any of the embodiments described above.
[0175] like Figure 4 As shown, it illustrates a structural schematic diagram of the computer device involved in the embodiments of this application, specifically:
[0176] The computer device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will understand that the computer device structure shown in the figures does not constitute a limitation on the computer device, and may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein:
[0177] Processor 401 is the control center of the computer device. It connects various parts of the computer device via various interfaces and lines, and performs various functions and processes data by running or executing software programs and / or modules stored in memory 402, and by calling data stored in memory 402, thereby providing overall monitoring of the computer device. Optionally, processor 401 may include one or more processing cores; processor 401 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor. Preferably, processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may not be integrated into processor 401.
[0178] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 402 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.
[0179] The computer device also includes a power supply 403 that supplies power to the various components. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 403 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0180] The computer device may also include an input unit 404, which can be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0181] Although not shown, the computer device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 401 in the computer device loads the executable files corresponding to the processes of one or more applications into the memory 402 according to the following instructions, and the processor 401 runs the applications stored in the memory 402 to realize various functions, as follows:
[0182] Obtain multiple first image identification information corresponding to the target dynamic scale operator number, wherein the first image identification information includes the target dynamic scale operator number;
[0183] The identification information of each first image is parsed to obtain multiple sorting line identifiers;
[0184] The sorting line identifier that appears more frequently than the preset frequency among multiple sorting line identifiers is identified as the target sorting line identifier corresponding to the target dynamic weigher number.
[0185] Anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target dynamic weigher number and the target sorting line identifier, and the anomaly detection results are obtained.
[0186] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be performed by instructions, or by instructions controlling related hardware. These instructions can be stored in a computer-readable storage medium and loaded and executed by a processor.
[0187] Therefore, embodiments of this application provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a disk, or an optical disk, etc. A computer program is stored thereon, and the computer program is loaded by a processor to execute the steps in any of the anomaly detection methods for sorting and weighing mapping relationships provided in embodiments of this application. For example, the computer program loaded by the processor can execute the following steps:
[0188] Obtain multiple first image identification information corresponding to the target dynamic scale operator number, wherein the first image identification information includes the target dynamic scale operator number;
[0189] The identification information of each first image is parsed to obtain multiple sorting line identifiers;
[0190] The sorting line identifier that appears more frequently than the preset frequency among multiple sorting line identifiers is identified as the target sorting line identifier corresponding to the target dynamic weigher number.
[0191] Anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target dynamic weigher number and the target sorting line identifier, and the anomaly detection results are obtained.
[0192] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0193] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0194] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0195] The above provides a detailed description of an anomaly detection method and apparatus for sorting and weighing mapping relationships provided in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. An anomaly detection method for sorting and weighing mapping relationships, characterized in that, The anomaly detection method includes: Obtain multiple first image identification information corresponding to the target dynamic weighing scale operator number, wherein the first image identification information includes the target dynamic weighing scale operator number; The identification information of each of the first images is parsed to obtain multiple sorting line identifiers; The sorting line identifiers that appear more frequently than a preset frequency among the multiple sorting line identifiers are identified as the target sorting line identifiers corresponding to the target dynamic weigher number. Obtain the target weighing site corresponding to the target dynamic scale operator number; Obtain the candidate dynamic scale operator numbers of multiple dynamic scales in the target weighing site; Each candidate dynamic weigher number is identified as a candidate sorting line identifier, resulting in multiple candidate sorting line identifiers. String matching is performed on any two candidate sorting line identifiers to obtain multiple matching keywords, wherein the matching keyword is the longest continuous string that is common to the two candidate sorting line identifiers; The most frequently occurring matching keyword among the multiple matching keywords is determined as the common feature of the sorting line identifier; Determine whether the target sorting line identifier matches the common features of the sorting line identifier; If the target sorting line identifier matches the common feature of the sorting line identifier, then anomaly detection is performed on the pre-stored sorting and weighing mapping relationship based on the target mapping relationship between the target dynamic weigher number and the target sorting line identifier, and anomaly detection results are obtained.
2. The anomaly detection method for sorting and weighing mapping relationship according to claim 1, characterized in that, The step involves parsing the identification information of each of the first images to obtain multiple sorting line identifiers, including: Obtain the target tracking number; Based on the target waybill number, the plurality of first image identification information is filtered to obtain a plurality of second image identification information, wherein the second image identification information includes the target waybill number; The identification information of each of the second images is parsed to obtain multiple sorting line identifiers.
3. The anomaly detection method for sorting and weighing mapping relationship according to claim 2, characterized in that, The step of parsing the identification information of each of the second images respectively yields multiple sorting line identifiers, including: Obtain the weighing time of the target waybill by the target dynamic weigher ID and the image upload time of the multiple second image identification information; Based on the weighing time and the image upload time, the plurality of second image identification information is filtered to obtain a plurality of third image identification information, wherein the time difference between the image upload time of the third image identification information and the weighing time of the target dynamic scale operator number is less than a preset time difference; The identification information of each of the third images is parsed to obtain multiple sorting line identifiers.
4. The anomaly detection method for sorting and weighing mapping relationship according to claim 3, characterized in that, The process of parsing the identification information of each of the third images yields multiple sorting line identifiers, including: Obtain the name string of the third image identification information; Based on the target waybill number, perform string matching on the name string to obtain the target waybill number position in the name string; The sorting line identifier position in the name string is determined based on the target waybill number position and the pre-stored position correspondence. The sorting line identifier is obtained by extracting characters from the name string based on the sorting line identifier position.
5. The anomaly detection method for sorting and weighing mapping relationship according to claim 1, characterized in that, The step of determining the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among the plurality of sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weigher number includes: Obtain the frequency of occurrence of each sorting line identifier; If at least two sorting line identifiers have an occurrence frequency higher than the preset occurrence frequency, then the sorting line identifier with the highest occurrence frequency among all sorting line identifiers is determined as the target sorting line identifier corresponding to the target dynamic weigher number.
6. An anomaly detection device for sorting and weighing mapping relationships, characterized in that, The anomaly detection device for the sorting and weighing mapping relationship includes: The acquisition unit is used to acquire multiple first image identification information corresponding to the target dynamic weighing scale operator number, wherein the first image identification information includes the target dynamic weighing scale operator number; The parsing unit is used to parse the identification information of each of the first images to obtain multiple sorting line identifiers; The determining unit is used to determine the sorting line identifier with an occurrence frequency higher than a preset occurrence frequency among the plurality of sorting line identifiers as the target sorting line identifier corresponding to the target dynamic weigher number. An anomaly detection unit is configured to: acquire the target weighing site corresponding to the target dynamic scale operator number; acquire candidate dynamic scale operator numbers of multiple dynamic scales in the target weighing site; determine the candidate sorting line identifier corresponding to each candidate dynamic scale operator number, thereby obtaining multiple candidate sorting line identifiers; perform string matching on any two candidate sorting line identifiers to obtain multiple matching keywords, wherein the matching keyword is the longest continuous string common to the two candidate sorting line identifiers; determine the matching keyword with the highest frequency among the multiple matching keywords as the common feature of the sorting line identifiers; determine whether the target sorting line identifier matches the common feature of the sorting line identifiers; if the target sorting line identifier matches the common feature of the sorting line identifiers, then perform anomaly detection on the pre-stored sorting and weighing mapping relationship according to the target mapping relationship between the target dynamic scale operator number and the target sorting line identifier, thereby obtaining an anomaly detection result.
7. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the anomaly detection method for the sorting and weighing mapping relationship as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps in the anomaly detection method for the sorting and weighing mapping relationship according to any one of claims 1 to 5.