Waybill data clustering method, device, computer equipment and storage medium

Through the waybill data clustering method, multiple grouping adjustments are used to use user information, solving the problem of high computational complexity of traditional methods, achieving efficient waybill data clustering, and reducing resource occupation.

CN114612025BActive Publication Date: 2025-02-14SF TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011398199.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-03
Publication Date
2025-02-14
Estimated Expiration
2040-12-03

AI Technical Summary

Technical Problem

When dealing with the logistics industry's collection and distribution problem, the traditional circular traversal method has a high computational complexity and requires excessive computing resources.

Method used

A waybill data clustering method is provided. By obtaining the waybill data to be clustered, grouping it according to the first user information, adjusting it to the second grouping result, and adjusting it again until the results converge, and effectively clustering of the waybill data.

Benefits of technology

It reduces the computational complexity and resource occupation, improves the efficiency of the collection and dispatch work, and is suitable for big data classification problems with diversity and irregularity in logistics scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114612025B_ABST
    Figure CN114612025B_ABST
Patent Text Reader

Abstract

The present application relates to a waybill data clustering method, device, computer equipment and storage medium. The method comprises: obtaining waybill data to be clustered; each waybill data to be clustered includes at least two types of user information; grouping the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered; adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered; adjusting the second grouping result again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and then taking the current grouping result obtained according to the first user information as the final grouping result. This method can realize the clustering of non-standard data and effectively reduce the computational complexity and resource occupancy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of logistics technology, and in particular to a waybill data clustering method, device, computer equipment and storage medium. Background Art

[0002] In recent years, with the rapid development of the logistics industry, people's requirements for logistics have become higher and higher. How to improve the circulation rate of logistics has become the focus of the logistics industry. In the actual scenario of the collection and dispatch problem, the same user may fill in multiple phone numbers when filling out an order, and these users may also share a monthly settlement account or fill in the address in an irregular manner, that is, a single user may have multiple ways of filling out the waybill, which brings a huge workload to the couriers in the collection / dispatch work, thereby affecting the efficiency of collection / dispatch.

[0003] Traditional methods are mostly to classify all waybills and personal information belonging to the same user through loop traversal, and then collect / dispatch them. However, as time goes by, the types and number of phone numbers, monthly settlement accounts, and irregular address combinations filled in by the same user will increase dramatically, and the computational complexity of traditional loop traversal methods will also increase exponentially, which will lead to excessive use of computing resources.

[0004] Therefore, for the collection and dispatch problem in the logistics industry, the traditional loop traversal method has the problem of high computational complexity and requires excessive computing resources. Summary of the invention

[0005] Based on this, it is necessary to provide a waybill data clustering method, device, computer equipment and storage medium to address the technical problems of the above-mentioned loop traversal method having high computational complexity and occupying excessive computing resources.

[0006] A waybill data clustering method, the method comprising:

[0007] Acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information;

[0008] Grouping the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered;

[0009] Adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered;

[0010] The second grouping result is adjusted again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and the current grouping result obtained according to the first user information is used as the final grouping result.

[0011] In one embodiment, the first grouping result includes at least two groups of waybill data to be clustered, and the method further includes:

[0012] Sort each group of waybill data to be clustered in the first grouping result to obtain a sequence number of each group of waybill data to be clustered as a first category label value of each group of waybill data to be clustered;

[0013] Or, randomly generate a first category label value for each group of waybill data to be clustered;

[0014] The first category label value of each group of waybill data to be clustered is different.

[0015] In one embodiment, the adjusting the first grouping result according to the second user information to obtain the second grouping result of the waybill data to be clustered includes:

[0016] Grouping the waybill data to be clustered according to the second user information to obtain an initial grouping result;

[0017] According to the initial grouping result, the first grouping result is adjusted so that each group of waybill data to be clustered in the obtained second grouping result satisfies at least one of the conditions that the first user information is the same and the second user information is the same.

[0018] In one embodiment, adjusting the first grouping result according to the initial grouping result includes:

[0019] All waybill data to be clustered included in each group of waybill data to be clustered in the initial grouping result are divided into the group to which the target waybill data to be clustered in the group belongs in the first grouping result, to obtain a second grouping result; the target waybill data to be clustered represents the waybill data with the smallest label value of the first category.

[0020] In one embodiment, after the waybill data to be clustered are grouped according to the second user information to obtain an initial grouping result, the method further includes:

[0021] Determine whether the first category label values ​​of each waybill data to be clustered contained in each group of waybill data to be clustered are the same;

[0022] If yes, the first category label value of the waybill data to be clustered in the group is used as the second category label value of the group of waybill data to be clustered;

[0023] If not, the smallest first category label value in the group of waybill data to be clustered is used as the second category label value of the group of waybill data to be clustered.

[0024] In one embodiment, the method further comprises:

[0025] Obtaining a first category label value corresponding to each waybill data to be clustered obtained according to the first user information previously;

[0026] Obtain a new first category label value corresponding to each waybill data to be clustered currently obtained according to the first user information;

[0027] If the new first category label value corresponding to each waybill data to be clustered is the same as the first category label value corresponding to the previous time, it is determined that the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information.

[0028] In one embodiment, the waybill data to be clustered further includes a waybill identifier; and the method further includes:

[0029] Mapping the waybill identifiers and the at least two pieces of user information of each waybill data to be clustered into feature matrices respectively;

[0030] Each of the feature matrices is clustered into a plurality of groups by a clustering algorithm to obtain a grouping result of the waybill data to be clustered.

[0031] A waybill data clustering device, the device comprising:

[0032] A data acquisition module is used to acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information;

[0033] A first grouping module, configured to group the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered;

[0034] A second grouping module, used for adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered;

[0035] The result determination module is used to adjust the second grouping result again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and then the current grouping result obtained according to the first user information is used as the final grouping result.

[0036] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0037] Acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information;

[0038] Grouping the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered;

[0039] Adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered;

[0040] The second grouping result is adjusted again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and the current grouping result obtained according to the first user information is used as the final grouping result.

[0041] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0042] Acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information;

[0043] Grouping the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered;

[0044] Adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered;

[0045] The second grouping result is adjusted again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and the current grouping result obtained according to the first user information is used as the final grouping result.

[0046] The above-mentioned waybill data clustering method, device, computer equipment and storage medium, after obtaining the waybill data to be clustered, first group the waybill data to be clustered according to the first user information to obtain a first grouping result, then adjust the first grouping result according to the second user information, and group the waybill data to be clustered with different first user information but the same second user information into one group to obtain a second grouping result, and adjust the second grouping result again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, so that any waybill data to be clustered with the same user information can be divided into the same group, so that the waybill data of the same user with different telephone numbers or different monthly settlement accounts or irregular addresses can be divided into the same group, thereby realizing the clustering of irregular data, which is particularly suitable for big data classification problems in logistics scenarios where some features are diverse and irregular. Each time, it is only necessary to adjust the previous grouping result according to the user information without re-traversal, which effectively reduces the computational complexity and resource usage. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 Schematic diagram of a process of clustering waybill data in one embodiment;

[0048] Figure 2 A schematic diagram of a flow chart of a first grouping result adjustment step in an embodiment;

[0049] Figure 3 It is a schematic diagram of the flow of a waybill data clustering method in another embodiment;

[0050] Figure 4 It is a structural block diagram of a waybill data clustering device in one embodiment;

[0051] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] In one embodiment, Figure 1 As shown, a waybill data clustering method is provided. This embodiment takes the method applied to a terminal as an example for illustration. It can be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0054] Step S102, obtaining waybill data to be clustered; each waybill data to be clustered includes at least two types of user information.

[0055] The waybill data to be clustered may include a waybill identifier and at least two pieces of user information.

[0056] The waybill identifier may represent a unique mark of each waybill, and the waybill identifier may be the waybill number. For example, the waybill identifier may be SFxxxxxxxx1.

[0057] The user information includes at least two of the following information: user phone number, monthly account number (eg, 0001), and user address.

[0058] For example, as shown in Table 1 below, it is an example of the acquired waybill data to be clustered. Each waybill data to be clustered includes three types of user information: user phone number, monthly settlement account number and user address.

[0059] Waybill Number Telephone Monthly Account address SFxxxxxxxx1 185xxxx0001 0001 1 / F, Block B, Chuangzhi SFxxxxxxxx2 185xxxx0002 0001 1 / F, Block B, Chuangzhi SFxxxxxxxx3 185xxxx0001 0002 1 / F, Block B, Chuangzhi SFxxxxxxxx4 185xxxx0001 0002 Creative B SFxxxxxxxx5 185xxxx0003 0003 Creative B SFxxxxxxxx6 185xxxx0003 0004 Creative B SFxxxxxxxx7 185xxxx0003 0005 C SFxxxxxxxx8 185xxxx0004 0006 Creative D SFxxxxxxxx9 185xxxx0004 0007 Creative E SFxxxxxxx10 185xxxx0007 0008 Creative A

[0060] Table 1

[0061] Step S104: grouping the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered.

[0062] In a specific implementation, after obtaining the waybill data to be clustered, the waybill data to be clustered can be grouped according to the first user information to obtain a first grouping result of the waybill data to be clustered, and then the previous grouping result of the waybill data to be clustered can be adjusted according to each user information in turn.

[0063] Further, in one embodiment, the first grouping result includes at least two groups of waybill data to be clustered, and the above method also includes: sorting each group of waybill data to be clustered in the first grouping result to obtain a serial number of each group of waybill data to be clustered as a first category label value for each group of waybill data to be clustered; or, randomly generating a first category label value for each group of waybill data to be clustered; wherein the first category label value of each group of waybill data to be clustered is different.

[0064] Among them, each group of waybill data to be clustered in the first grouping result has a corresponding first category label value.

[0065] For example, taking the waybill data to be clustered in Table 1 as an example, the waybill data to be clustered can be grouped according to the telephone number first, and the waybill data to be clustered with the same telephone number can be divided into the same group, thereby obtaining at least two groups of waybill data to be clustered, and then the first category label value can be assigned to each group of data to be clustered according to the sorting method, or the first category label value of each group of data to be clustered can be randomly generated under the condition that the first category label value of each group of data to be clustered is different. As shown in Table 2 below, the value under the label A1 column indicates the first category label value assigned to each waybill data to be clustered after grouping according to the telephone number. It can be seen from the table that the telephone numbers of waybill numbers SFxxxxxxxx1, SFxxxxxxxx3 and SFxxxxxxxx4 are the same, belong to the same group, and the first category label value is 1.

[0066] Waybill Number Telephone Monthly Account address Label A1 SFxxxxxxxx1 185xxxx0001 0001 1 / F, Block B, Chuangzhi 1 SFxxxxxxxx2 185xxxx0002 0001 1 / F, Block B, Chuangzhi 2 SFxxxxxxxx3 185xxxx0001 0002 1 / F, Block B, Chuangzhi 1 SFxxxxxxxx4 185xxxx0001 0002 Creative B 1 SFxxxxxxxx5 185xxxx0003 0003 Creative B 3 SFxxxxxxxx6 185xxxx0003 0004 Creative B 3 SFxxxxxxxx7 185xxxx0003 0005 C 3 SFxxxxxxxx8 185xxxx0004 0006 Creative D 4 SFxxxxxxxx9 185xxxx0004 0007 Creative E 4 SFxxxxxxx10 185xxxx0007 0008 Creative A 5

[0067] Table 2

[0068] Step S106: adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered.

[0069] Further, in one embodiment, if Figure 2 As shown, step S106 specifically includes:

[0070] Step S202: group the waybill data to be clustered according to the second user information to obtain an initial grouping result.

[0071] Step S204: adjusting the first grouping result according to the initial grouping result, so that each group of waybill data to be clustered in the obtained second grouping result satisfies at least one of the conditions of the first user information being the same and the second user information being the same.

[0072] Further, step S204 specifically includes: dividing all waybill data to be clustered included in each group of waybill data to be clustered in the initial grouping result into the group to which the target waybill data to be clustered in the group belongs in the first grouping result, to obtain a second grouping result; the target waybill data to be clustered represents the waybill data with the smallest label value of the first category.

[0073] In a specific implementation, in actual collection / dispatch scenarios in the logistics industry, records with the same telephone number or monthly settlement account number or address generally belong to the same collection and dispatch user. Therefore, after the first user information of each group of waybill data to be clustered in the first grouping result is made the same through grouping by the first user information, the first grouping result can be further adjusted according to the second user information, and the waybill data to be clustered with different first user information but the same second user information can be divided into the same group, so that the first user information and / or the second user information of each group of waybill data to be clustered in the second grouping result are the same.

[0074] In one embodiment, after step S202, it also includes: determining whether the first category label values ​​of each waybill data to be clustered contained in each group of waybill data to be clustered are the same; if so, using the first category label value of the waybill data to be clustered in the group as the second category label value of the group of waybill data to be clustered; if not, using the smallest first category label value in the group of waybill data to be clustered as the second category label value of the group of waybill data to be clustered.

[0075] For example, after the waybill data are grouped according to the telephone number, the monthly settlement account number can be used as the second user information to adjust the first grouping result. As shown in Table 2 above, after the waybill data are grouped according to the monthly settlement account number, it can be obtained that the waybill numbers SFxxxxxxxx1 and SFxxxxxxxx2 should belong to the same group, but the label values ​​of the first category labels A1 of the two are not the same. In this case, the waybill data to be clustered with the smallest first category label value, that is, SFxxxxxxxx1 with a first category label value of 1, can be used as the target waybill data to be clustered. The waybill data to be clustered with waybill number SFxxxxxxxx2 is divided into the group "SFxxxxxxxx1, SFxxxxxxxx3 and SFxxxxxxxx4" to which the target waybill data to be clustered SFxxxxxxxx1 belongs in the first grouping result, and a new group "SFxxxxxxxx1, SFxxxxxxxx2, SFxxxxxxxx3 and SFxxxxxxxx4" is obtained. The first category label value 1 of the target waybill data to be clustered SFxxxxxxxx1 in the group "SFxxxxxxxx1 and SFxxxxxxxx2" in the second grouping result is used as the second category label value of the new group. Therefore, the second category label value of the waybill data to be clustered with waybill number SFxxxxxxxx2 will be adjusted to 1, and so on, the second category label values ​​of each waybill data to be clustered under the second category label B1 as shown in Table 3 below.

[0076] Waybill Number Telephone Monthly Account address Label A1 Label B1 SFxxxxxxxx1 185xxxx0001 0001 1 / F, Block B, Chuangzhi 1 1 SFxxxxxxxx2 185xxxx0002 0001 1 / F, Block B, Chuangzhi 2 1 SFxxxxxxxx3 185xxxx0001 0002 1 / F, Block B, Chuangzhi 1 1 SFxxxxxxxx4 185xxxx0001 0002 Creative B 1 1 SFxxxxxxxx5 185xxxx0003 0003 Creative B 3 3 SFxxxxxxxx6 185xxxx0003 0004 Creative B 3 3 SFxxxxxxxx7 185xxxx0003 0005 C 3 3 SFxxxxxxxx8 185xxxx0004 0006 Creative D 4 4 SFxxxxxxxx9 185xxxx0004 0007 Creative E 4 4 SFxxxxxxx10 185xxxx0007 0008 Creative A 5 5

[0077] Table 3

[0078] Similarly, if the waybill data to be clustered also includes third user information, after obtaining the second grouping result according to the second user information, the second grouping result can be adjusted according to the third user information "user address" to obtain the third grouping result shown in Table 4 below, as well as the third category label value of each waybill data to be clustered under the third category label C1.

[0079] Waybill Number Telephone Monthly Account address Label A1 Label B1 Label C1 SFxxxxxxxx1 185xxxx0001 0001 1 / F, Block B, Chuangzhi 1 1 1 SFxxxxxxxx2 185xxxx0002 0001 1 / F, Block B, Chuangzhi 2 1 1 SFxxxxxxxx3 185xxxx0001 0002 1 / F, Block B, Chuangzhi 1 1 1 SFxxxxxxxx4 185xxxx0001 0002 Creative B 1 1 1 SFxxxxxxxx5 185xxxx0003 0003 Creative B 3 3 1 SFxxxxxxxx6 185xxxx0003 0004 Creative B 3 3 1 SFxxxxxxxx7 185xxxx0003 0005 C 3 3 3 SFxxxxxxxx8 185xxxx0004 0006 Creative D 4 4 4 SFxxxxxxxx9 185xxxx0004 0007 Creative E 4 4 4 SFxxxxxxx10 185xxxx0007 0008 Creative A 5 5 5

[0080] Table 4

[0081] Step S108, adjusting the second grouping result again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and then taking the current grouping result obtained according to the first user information as the final grouping result.

[0082] In a specific implementation, after adjusting the grouping results of the first cycle according to each user information, in order to determine whether the grouping results have converged, the previous grouping results can be adjusted again according to the first user information to obtain a new first grouping result and a new first category label value, and it is determined whether the new first grouping result obtained according to the first user information is the same as the first grouping result. If they are the same, the cycle is terminated and the new first grouping result is used as the final clustering result of the waybill data to be clustered. If they are not the same, return to step S106, enter the second cycle, and adjust the new first grouping result again according to the second user information until the new first grouping result currently obtained according to the first user information is the same as the first grouping result obtained according to the first user information last time.

[0083] For example, after obtaining the third grouping result and the third classification label value shown in Table 4, the third grouping result is adjusted again according to the first user information, i.e., the phone number, to obtain a new grouping result and a new first category label value under the new first category label A2 as shown in Table 5 below. As can be seen from the table, the grouping results of label A2 and label A1 are different. Therefore, it is necessary to continue to adjust the classification results of label A2 in turn according to the monthly settlement account number and address to obtain the grouping result of label A3. If the grouping result of label A3 is the same as the grouping result of label A2, the loop ends and the grouping result corresponding to label A3 is used as the final grouping result.

[0084] Waybill Number Telephone Monthly Account address Label A1 Label B1 Label C1 Label A2 SFxxxxxxxx1 185xxxx0001 0001 1 / F, Block B, Chuangzhi 1 1 1 1 SFxxxxxxxx2 185xxxx0002 0001 1 / F, Block B, Chuangzhi 2 1 1 1 SFxxxxxxxx3 185xxxx0001 0002 1 / F, Block B, Chuangzhi 1 1 1 1 SFxxxxxxxx4 185xxxx0001 0002 Creative B 1 1 1 1 SFxxxxxxxx5 185xxxx0003 0003 Creative B 3 3 1 1 SFxxxxxxxx6 185xxxx0003 0004 Creative B 3 3 1 1 SFxxxxxxxx7 185xxxx0003 0005 C 3 3 3 1 SFxxxxxxxx8 185xxxx0004 0006 Creative D 4 4 4 4 SFxxxxxxxx9 185xxxx0004 0007 Creative E 4 4 4 4 SFxxxxxxx10 185xxxx0007 0008 Creative A 5 5 5 5

[0085] Table 5

[0086] In the above-mentioned waybill data clustering method, after obtaining the waybill data to be clustered, the waybill data to be clustered are first grouped according to the first user information to obtain a first grouping result, and then the first grouping result is adjusted according to the second user information, and the waybill data to be clustered with different first user information but the same second user information are grouped into a group to obtain a second grouping result, and the second grouping result is adjusted again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, so that any waybill data to be clustered with the same user information can be divided into the same group, so that the waybill data of the same user with different telephone numbers or different monthly settlement accounts or irregular addresses can be divided into the same group, thereby realizing the clustering of irregular data, which is particularly suitable for big data classification problems in logistics scenarios where some features are diverse and irregular. Each time, it is only necessary to adjust the previous grouping result according to the user information without re-traversal, which effectively reduces the computational complexity and resource usage.

[0087] In one embodiment, the above method also includes: obtaining the first category label value corresponding to each waybill data to be clustered obtained according to the first user information last time; obtaining the new first category label value corresponding to each waybill data to be clustered obtained according to the first user information currently; if the new first category label value corresponding to each waybill data to be clustered is the same as the first category label value corresponding to the previous time, it is determined that the grouping result currently obtained according to the first user information is the same as the grouping result obtained according to the first user information last time.

[0088] In this embodiment, the new first category label value of the waybill data to be clustered currently obtained based on the first user information is compared with the first category label value obtained last time based on the first user information, so as to determine whether the grouping result converges based on the comparison result and whether it is necessary to enter the next cycle and iterate again.

[0089] In one embodiment, the waybill data to be clustered also includes a waybill identification; the above method also includes: mapping the waybill identification of each waybill data to be clustered and at least two user information into a feature matrix; clustering each feature matrix into multiple groups through a clustering algorithm to obtain the grouping result of the waybill data to be clustered.

[0090] In a specific implementation, the waybill identifier and the user information included in the waybill data to be clustered can be mapped into a feature matrix by the word embedding method (word embedding means the process of mapping a word to a real-valued vector space), wherein only the text part needs to be word-embedded, and the numeric part does not need to be word-embedded. For example, for the waybill data to be clustered including the user's phone number, user account number and user address, only the user address can be word-embedded, and the user's phone number and user account number do not need to be processed, thereby obtaining the feature matrix corresponding to each waybill data to be clustered. The feature matrices corresponding to each waybill data to be clustered are further grouped by clustering algorithms such as kmeans and hierarchical clustering. Specifically, several feature matrices can be selected as the initial centroid first, and the grouping results can be obtained according to the Euclidean distance between each feature matrix and the initial centroid, and the new centroid of each group is recalculated until the distance between the new centroid and the previous centroid is less than the preset distance threshold, and the grouping result corresponding to the previous centroid is used as the final grouping result.

[0091] In this embodiment, by mapping each waybill data to be clustered into a feature matrix, and then using a clustering algorithm to cluster each feature matrix, the grouping result of the waybill data to be clustered is obtained. There is no need to loop through each waybill data to be clustered, which can effectively reduce the computational complexity and amount of calculation, thereby solving the problems of high computational complexity and high resource usage of traditional traversal algorithms.

[0092] In one embodiment, Figure 3 As shown, in order to more clearly illustrate the technical solution provided by the embodiment of the present application, an application example of the waybill data clustering method of the present application will be described in detail below. The specific process of the method is as follows:

[0093] (1) Obtain user data (i.e., waybill data to be clustered), including waybill number, phone number, monthly settlement account number, and address.

[0094] (2) The telephone number is used as the first user information, and the user data is grouped and sorted for the first time according to the telephone number (wherein, records with the same telephone number are marked with the same ordinal number), and the obtained ordinal number is used as the first category label value of each user data, and the first category label is recorded as A1.

[0095] (3) The monthly settlement account is used as the second user information, and the user data is grouped for the second time according to the monthly settlement account. The minimum value of the sequence number in the group (equivalent to the minimum first category label value) is calculated, and this minimum value is used as the second category label value of the group. The second category label is recorded as B1.

[0096] (4) Take the user address as the third user information, group the user data for the third time according to the user address, and find the minimum ordinal value within the group (equivalent to the minimum second category label value). Use this minimum value as the third category label value of the group, and record the third category label as C1.

[0097] (5) The user data is grouped again according to the first user information (telephone number), and the minimum ordinal value within the group is calculated (equivalent to the minimum third category label value). This minimum value is used as the new first category label value, and the new first category label is recorded as A2.

[0098] (6) Compare the label value of the new first category label column A2 with the label value of the previous first category label column A1. If they are the same, it means that the result has converged, and the result corresponding to the label in column A2 is the final classification result. If they are different, it means that the result has not converged yet, and the above steps need to be repeated until the label value of the new label column A(i+1) is exactly the same as the label value of column A(i).

[0099] The waybill data clustering algorithm provided in this embodiment only needs to adjust the previous grouping result according to user information each time, without the need to re-traverse, which effectively reduces the calculation complexity and resource usage, and can be applied to various scenarios such as centralized collection and delivery, fixed accrual for couriers, and risky customer clustering.

[0100] It should be understood that although Figure 1-3 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1-3 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0101] In one embodiment, Figure 4 As shown, a waybill data clustering device is provided, including: a data acquisition module 402, a second grouping module 406, a second grouping module 406 and a result determination module 408, wherein:

[0102] The data acquisition module 402 is used to acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information;

[0103] The second grouping module 406 is used to group the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered;

[0104] The second grouping module 406 is used to adjust the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered;

[0105] The result determination module 408 is used to adjust the second grouping result again according to the first user information until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and then the current grouping result obtained according to the first user information is used as the final grouping result.

[0106] In one embodiment, the first grouping result includes at least two groups of waybill data to be clustered, and the above-mentioned device also includes a first label value generation module, which is used to sort the groups of waybill data to be clustered in the first grouping result, and obtain the serial number of each group of waybill data to be clustered as the first category label value of each group of waybill data to be clustered; or, randomly generate the first category label value of each group of waybill data to be clustered; wherein the first category label value of each group of waybill data to be clustered is different.

[0107] In one embodiment, the above-mentioned second grouping module 406 is specifically used to group the waybill data to be clustered according to the second user information to obtain an initial grouping result; based on the initial grouping result, the first grouping result is adjusted so that each group of waybill data to be clustered in the obtained second grouping result satisfies at least one of the conditions that the first user information is the same and the second user information is the same.

[0108] In one embodiment, the above-mentioned second grouping module 406 is also used to divide all the waybill data to be clustered included in each group of waybill data to be clustered in the initial grouping result into the group to which the target waybill data to be clustered in the group belongs in the first grouping result, to obtain the second grouping result; the target waybill data to be clustered represents the waybill data with the smallest label value of the first category.

[0109] In one embodiment, the above-mentioned device also includes a second label value generating module, which is used to determine whether the first category label values ​​of each waybill data to be clustered contained in each group of waybill data to be clustered are the same; if so, the first category label value of the waybill data to be clustered in the group is used as the second category label value of the group of waybill data to be clustered; if not, the smallest first category label value in the group of waybill data to be clustered is used as the second category label value of the group of waybill data to be clustered.

[0110] In one embodiment, the above-mentioned result judgment module 408 is specifically used to obtain the first category label value corresponding to each waybill data to be clustered obtained according to the first user information last time; obtain the new first category label value corresponding to each waybill data to be clustered obtained according to the first user information currently; if the new first category label value corresponding to each waybill data to be clustered is the same as the first category label value corresponding to the previous time, it is determined that the grouping result currently obtained according to the first user information is the same as the grouping result obtained according to the first user information last time.

[0111] In one embodiment, the waybill data to be clustered also includes a waybill identifier, and the above-mentioned device further includes:

[0112] A mapping module, used to map the waybill identifier of each waybill data to be clustered and at least two user information into a feature matrix;

[0113] The clustering module is used to cluster each feature matrix into multiple groups through a clustering algorithm to obtain the grouping results of the waybill data to be clustered.

[0114] It should be noted that the waybill data clustering device of the present application corresponds one-to-one to the waybill data clustering method of the present application. The technical features and beneficial effects described in the embodiment of the above-mentioned waybill data clustering method are all applicable to the embodiment of the waybill data clustering device. For specific contents, please refer to the description in the embodiment of the method of the present application. It will not be repeated here. This is hereby declared.

[0115] In addition, each module in the above-mentioned waybill data clustering device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0116] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a waybill data clustering method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0117] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0118] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0119] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0120] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0121] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0122] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A waybill data clustering method, characterized in that: The method comprises: Acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information; The waybill data to be clustered are grouped according to the first user information to obtain a first grouping result of the waybill data to be clustered; each group of waybill data to be clustered under the first grouping result has a corresponding first category label value; The first grouping result is adjusted according to the second user information to obtain a second grouping result of the waybill data to be clustered; each group of waybill data to be clustered under the second grouping result has a corresponding second category label value; the second grouping result is adjusted according to the first user information to obtain a current grouping result obtained according to the first user information; If the current grouping result obtained according to the first user information is different from the previous grouping result obtained according to the first user information, the current grouping result obtained according to the first user information is used as the new first grouping result, and the step of adjusting the first grouping result according to the second user information to obtain the second grouping result of the waybill data to be clustered is returned until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and the current grouping result obtained according to the first user information is used as the final grouping result; Among them, the second category label value of each group of waybill data to be clustered under the second grouping result is the minimum first category label value among the first category label values ​​of all waybill data to be clustered included in the group of waybill data to be clustered; the category label value of each group of waybill data to be clustered under the grouping result currently obtained according to the first user information is the minimum second category label value among the second category label values ​​of all waybill data to be clustered included in the group of waybill data to be clustered.

2. The method according to claim 1, characterized in that The first grouping result includes at least two groups of waybill data to be clustered, and the method further includes: Sort each group of waybill data to be clustered in the first grouping result to obtain a sequence number of each group of waybill data to be clustered as a first category label value of each group of waybill data to be clustered; Or, randomly generate a first category label value for each group of waybill data to be clustered; The first category label value of each group of waybill data to be clustered is different.

3. The method according to claim 2, characterized in that The adjusting the first grouping result according to the second user information to obtain the second grouping result of the waybill data to be clustered includes: Grouping the waybill data to be clustered according to the second user information to obtain an initial grouping result; According to the initial grouping result, the first grouping result is adjusted so that each group of waybill data to be clustered in the obtained second grouping result satisfies at least one of the conditions that the first user information is the same and the second user information is the same.

4. The method according to claim 3, characterized in that The adjusting the first grouping result according to the initial grouping result includes: All waybill data to be clustered included in each group of waybill data to be clustered in the initial grouping result are divided into the group to which the target waybill data to be clustered in the group belongs in the first grouping result, to obtain a second grouping result; the target waybill data to be clustered represents the waybill data with the smallest label value of the first category.

5. The method according to claim 3, characterized in that: After the waybill data to be clustered are grouped according to the second user information to obtain an initial grouping result, the method further includes: Determine whether the first category label values ​​of each waybill data to be clustered contained in each group of waybill data to be clustered are the same; If yes, the first category label value of the waybill data to be clustered in the group is used as the second category label value of the group of waybill data to be clustered; If not, the smallest first category label value in the group of waybill data to be clustered is used as the second category label value of the group of waybill data to be clustered.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Obtaining a first category label value corresponding to each waybill data to be clustered obtained according to the first user information previously; Obtain a new first category label value corresponding to each waybill data to be clustered currently obtained according to the first user information; If the new first category label value corresponding to each waybill data to be clustered is the same as the first category label value corresponding to the previous time, it is determined that the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information.

7. The method according to claim 1, characterized in that The waybill data to be clustered also includes a waybill identifier; and the method further includes: Mapping the waybill identifiers and the at least two pieces of user information of each waybill data to be clustered into feature matrices respectively; Each of the feature matrices is clustered into a plurality of groups by a clustering algorithm to obtain a grouping result of the waybill data to be clustered.

8. A waybill data clustering device, characterized in that: The device comprises: A data acquisition module is used to acquire waybill data to be clustered; each waybill data to be clustered includes at least two types of user information; A first grouping module, configured to group the waybill data to be clustered according to the first user information to obtain a first grouping result of the waybill data to be clustered; each group of waybill data to be clustered under the first grouping result has a corresponding first category label value; A second grouping module, used for adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered; each group of waybill data to be clustered under the second grouping result has a corresponding second category label value; a result determination module, configured to adjust the second grouping result according to the first user information to obtain a current grouping result obtained according to the first user information; if the current grouping result obtained according to the first user information is different from the previous grouping result obtained according to the first user information, use the current grouping result obtained according to the first user information as the new first grouping result, return to the step of adjusting the first grouping result according to the second user information to obtain a second grouping result of the waybill data to be clustered, until the current grouping result obtained according to the first user information is the same as the previous grouping result obtained according to the first user information, and use the current grouping result obtained according to the first user information as the final grouping result; Among them, the second category label value of each group of waybill data to be clustered under the second grouping result is the minimum first category label value among the first category label values ​​of all waybill data to be clustered included in the group of waybill data to be clustered; the category label value of each group of waybill data to be clustered under the grouping result currently obtained according to the first user information is the minimum second category label value among the second category label values ​​of all waybill data to be clustered included in the group of waybill data to be clustered.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Label generating method for user to mark and label generating equipment for user to mark

    CN105045911A

  • A system and method for allocating an item

    WO2014040134A1