An order issuing control method and device based on a rule engine and electronic equipment
By using a rule-based order distribution control method, which extracts order keywords using algorithms based on global similarity and word similarity, and then classifies them, the problem of inflexibility and inefficiency in order distribution is solved, thus achieving orderly distribution and system stability.
Patent Information
- Application Number
- CN202511745311.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-26
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-11-26
AI Technical Summary
The lack of flexibility in the order placement methods of existing internet trading platforms leads to high pressure on downstream systems, low processing efficiency, inability to guarantee stable operation, and low efficiency of manual screening.
A rule-based order distribution control method is adopted. The algorithm extracts candidate keywords for orders through global similarity and word similarity, calculates the importance score of the keywords, and uses the rule engine to classify and process the orders, pushing them to the rejection, immediate or planned distribution data pool.
It enables flexible order categorization and push, reducing the pressure on downstream systems, ensuring the stability of system operation, improving processing efficiency, and reducing the error rate.
Smart Images

Figure CN121213201B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of order push technology, specifically relating to an order issuance control method, device, and electronic device based on a rule engine. Background Technology
[0002] With the rapid development of internet technology, users are using online platforms for consumption and transactions more and more frequently. At the same time, the amount of order data generated during online and offline consumption and transactions is also increasing. Therefore, efficient order processing has become an important part of ensuring the timeliness of order logistics.
[0003] Currently, existing internet trading platforms typically capture online transaction data and generate orders through their business systems, then directly send these orders to downstream systems for processing (such as inventory allocation). This uncontrolled order distribution method increases the pressure on downstream systems. For example, some orders may not meet relevant rules, preventing downstream systems from processing them and leading to order backlog. Similarly, sending orders that don't require immediate processing directly to downstream systems increases their workload, preventing priority processing of orders that need immediate attention and impacting timeliness. While manual order screening can address these shortcomings, this method is inefficient and unsuitable for large-scale order processing. Thus, the existing order processing suffers from poor flexibility, failing to guarantee the stability of downstream system operations, and manual order screening is not conducive to efficient order data processing.
[0004] Therefore, given the aforementioned shortcomings, how to provide a rule engine-based order issuance control method that is highly flexible and can guarantee order processing efficiency and the stable operation of downstream systems has become an urgent problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide a rule engine-based order issuance control method, device, and electronic device to solve the problems of poor flexibility, inability to guarantee the stability of downstream system operation, and low efficiency caused by manual order screening in the existing technology.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] Firstly, a rule engine-based order issuance control method is provided, including:
[0008] Obtain an order push command, wherein the order push command contains order data;
[0009] The order candidate keyword set is obtained by extracting candidate keywords from order data in an order push command based on a keyword extraction algorithm based on global similarity and word similarity.
[0010] The word importance, word attention and word relevance of each order candidate keyword in the order candidate keyword set are calculated, and the importance score of each order candidate keyword relative to the order data is calculated based on the word importance, word attention and word relevance of each order candidate keyword.
[0011] A number of order keywords are determined from the order candidate keyword set based on the importance score of each order candidate keyword.
[0012] Based on the number of order keywords, effective order information is determined from the order data.
[0013] The rule engine is used to perform rule matching on the effective order information, and the order data is pushed to the rejection delivery data pool, the immediate delivery data pool or the planned delivery data pool according to the rule matching result, so that the order data is pushed to the downstream system according to the push rules corresponding to the rejection delivery data pool, the immediate delivery data pool or the planned delivery data pool.
[0014] Based on the above disclosure, after obtaining an order push command containing order data, the order candidate keyword set of the order data in the order push command is extracted by using a keyword extraction algorithm based on global similarity and word similarity. Then, the word importance, word attention and word relevance of each order candidate keyword in the order candidate keyword set are calculated, and based on this, the importance score of each order candidate keyword relative to the order data is obtained, so that a number of order keywords are determined by using the aforementioned importance score. Then, the effective order information can be determined according to the number of order keywords. Then, the rule engine is used to perform rule matching on the effective order information, so that the order data is delivered to the rejection delivery data pool, the immediate delivery data pool or the planned delivery data pool. Finally, the order data can be sequentially pushed according to the push rules corresponding to different types of data pools.
[0015] Through the above design, the application extracts effective order information by automatically identifying order characteristics; then, the order is classified and processed according to preset rules, that is, the order pushed by the upstream system is stored in different data pools through three data pools of rejection, instant issuance and planned issuance, and based on rule matching; finally, the order can be sequentially issued according to the push rules of different data pools; thus, compared with the traditional direct issuance of the order to the downstream system, the application realizes the classified push of the order, so that the flexibility of order issuance is improved, and the sequential issuance of the order is realized, thereby reducing the operation pressure of the downstream system and ensuring the stability of system operation; at the same time, the whole process does not need manual intervention, improves the efficiency and reduces the error rate; therefore, the application is very suitable for large-scale application and promotion.
[0016] In one possible design, a word extraction algorithm based on global similarity and word similarity is adopted to extract candidate keywords from order data in an order push command to obtain an order candidate keyword set, including:
[0017] The order data is subjected to word segmentation processing to obtain a word segmentation set;
[0018] An initial candidate keyword set and a candidate keyword set at the kth iteration are obtained, wherein when k is 1, the initial candidate keyword set at the kth iteration contains a target word, the candidate keyword set at the kth iteration is the word segmentation set after removing the target word, and the target word is the word with the highest similarity to the order data in the word segmentation set;
[0019] It is judged whether an iteration stop condition is met, wherein the iteration stop condition is that the total number of keywords in the initial candidate keyword set at the kth iteration reaches a preset threshold;
[0020] If not, the global similarity between any candidate keyword in the candidate keyword set at the kth iteration and the order data, and the word similarity between the any candidate keyword and each initial candidate keyword in the initial candidate keyword set at the kth iteration are calculated;
[0021] The candidate score of the any candidate keyword is calculated according to the global similarity and the word similarity, and the candidate scores of all candidate keywords are obtained after all the candidate keywords in the candidate keyword set are polled;
[0022] The candidate keyword with the highest candidate score is added to the initial candidate keyword set at the kth iteration to obtain the initial candidate keyword set at the (k+1)th iteration, and the candidate keyword with the highest candidate score is deleted from the candidate keyword set to obtain the candidate keyword set at the (k+1)th iteration;
[0023] The k is increased by 1, and the initial candidate word set and the candidate word set in the kth iteration are reacquired, until the iteration stopping condition is met, and the initial candidate word set meeting the iteration stopping condition is taken as the order candidate keyword set.
[0024] In a possible design, a candidate score of any candidate word is calculated according to the global similarity and the inter-word similarity, including:
[0025] The maximum inter-word similarity is screened from the inter-word similarities;
[0026] A first hyperparameter is acquired, and a difference between a hyperparameter threshold and the first hyperparameter is calculated to obtain a second hyperparameter;
[0027] The first hyperparameter is multiplied by the global similarity, and the second hyperparameter is multiplied by the maximum inter-word similarity, to obtain a first product and a second product respectively;
[0028] A difference between the first product and the second product is calculated to obtain the candidate score of any candidate word.
[0029] In a possible design, a word importance of each order candidate keyword in the order candidate keyword set is calculated, including:
[0030] For any order candidate keyword, a word weight of the order candidate keyword is calculated;
[0031] An occurrence frequency of the order candidate keyword in the order data is counted;
[0032] A historical order database is acquired, and a first historical order containing the most order keywords and a second historical order containing the least order keywords are screened from the historical order database;
[0033] According to the occurrence frequency, a total number of order keywords of the first historical order and a total number of order keywords of the second historical order, a term frequency feature value of the order candidate keyword is calculated;
[0034] From the historical order database, a total number of historical orders containing the order candidate keyword is counted, and a number of occurrences of the order candidate keyword in each historical order in the historical order database is counted;
[0035] The maximum number of occurrences and the minimum number of occurrences are screened from the numbers of occurrences;
[0036] According to the total number, the maximum number of occurrences and the minimum number of occurrences, an inverse document feature value of the order candidate keyword is calculated;
[0037] Based on the word frequency feature value, the inverse document feature value and the word weight, a word importance degree of the any order candidate keyword is calculated.
[0038] In a possible design, the word weight of the any order candidate keyword is calculated, including:
[0039] From the order data, a position of occurrence of the any order candidate keyword and a part of speech of the any order candidate keyword at each position of occurrence are determined;
[0040] According to the position of occurrence of the any order candidate keyword, a position weight of the any order candidate keyword is calculated;
[0041] Based on the position weight, a position feature of the any order candidate keyword is calculated;
[0042] Using the part of speech of the any order candidate keyword at each position of occurrence, a part of speech feature of the any order candidate keyword is calculated;
[0043] An average word length of all order candidate keywords in the order candidate keyword set is calculated, and according to the word length of the any order candidate keyword and the average word length, a word length feature of the any order candidate keyword is calculated;
[0044] Using the position feature, the part of speech feature and the word length feature of the any order candidate keyword, the word weight of the any order candidate keyword is calculated.
[0045] In a possible design, according to the occurrence frequency, the total number of order keywords of the first historical order and the total number of order keywords of the second historical order, the word frequency feature value of the any order candidate keyword is calculated, including:
[0046] According to the occurrence frequency, an initial word frequency feature value of the any order candidate keyword is calculated;
[0047] Based on the occurrence frequency and the total number of order keywords of the first historical order, a first word frequency intermediate parameter is calculated, and based on the occurrence frequency and the total number of order keywords of the second historical order, a second word frequency intermediate parameter is calculated;
[0048] The first word frequency intermediate parameter and the second word frequency intermediate parameter are summed to obtain a third word frequency intermediate parameter;
[0049] A word frequency control factor is obtained, and using the word frequency control factor, the initial word frequency feature value and the third word frequency intermediate parameter, the word frequency feature value is calculated.
[0050] In one possible design, a word attention degree of each order candidate keyword in the order candidate keyword set is calculated, including:
[0051] An attention weight matrix of all order candidate keywords in the order candidate keyword set is extracted by using a self-attention mechanism, where a size of the attention weight matrix is , The token number corresponding to the order candidate keyword set is represented, and any order candidate keyword is composed of at least one token;
[0052] According to the attention weight matrix, an attention value of each token is calculated;
[0053] An attention matrix is constructed by using the attention value of each token;
[0054] Based on the attention matrix and the attention weight matrix, an inter-word correlation matrix is generated;
[0055] According to the inter-word correlation matrix, a correlation value of each token is calculated;
[0056] An actual attention degree of each token is calculated by using the attention value and the correlation value of each token;
[0057] For any order candidate keyword, all tokens constituting the any order candidate keyword are determined, and an actual attention degree of each token constituting the any order candidate keyword is calculated.
[0058] In one possible design, a rule engine is used to perform rule matching on valid order information, and according to a rule matching result, the order data is pushed to a rejected delivery data pool, an immediate delivery data pool, or a planned delivery data pool, including:
[0059] If an order number in the valid order information belongs to a rejected order number and / or a delivery address in the valid order information belongs to a logistics super-region address, it is concluded that the rule matching result is a rejected delivery order, and the order data is pushed to the rejected delivery data pool;
[0060] If there is a specified delivery time and / or payment delay information in the valid order information, it is concluded that the rule matching result is a planned delivery order, and the order data is pushed to the planned delivery data pool;
[0061] If an order amount in the valid order information exceeds a preset amount, an order customer belongs to a specified customer, and / or an order type belongs to a specified order type, it is concluded that the rule matching result is an immediate delivery order, and the order data is pushed to the immediate delivery data pool, where the specified order type is a commercial allocation order, a platform direct delivery order, or a first order.
[0062] In a second aspect, a rule engine-based order issuing control apparatus is provided, comprising:
[0063] An acquisition unit configured to acquire an order pushing command, wherein the order pushing command contains order data;
[0064] A candidate keyword extraction unit configured to perform candidate keyword extraction on the order data in the order pushing command by using a keyword extraction algorithm based on global similarity and word similarity, to obtain a set of order candidate keywords;
[0065] A keyword extraction unit configured to calculate word importance, word attention, and word relevance of each order candidate keyword in the set of order candidate keywords, and calculate an importance score of each order candidate keyword relative to the order data according to the word importance, the word attention, and the word relevance of each order candidate keyword;
[0066] The keyword extraction unit is further configured to determine a number of order keywords from the set of order candidate keywords according to the importance score of each order candidate keyword;
[0067] An order information extraction unit configured to determine valid order information from the order data based on the number of order keywords;
[0068] An order issuing unit configured to perform rule matching on the valid order information by using a rule engine, and push the order data to a rejection issuing data pool, an instant issuing data pool, or a plan issuing data pool according to a rule matching result, so as to push the order data to a downstream system according to a pushing rule corresponding to the rejection issuing data pool, the instant issuing data pool, or the plan issuing data pool.
[0069] In a third aspect, another rule engine-based order issuing control apparatus is provided, taking an electronic device as an example, comprising a memory, a processor, and a transceiver connected in sequence and in communication, wherein the memory is configured to store a computer program, the transceiver is configured to receive and send messages, and the processor is configured to read the computer program and execute the rule engine-based order issuing control method as in the first aspect or any possible design of the first aspect.
[0070] In a fourth aspect, a storage medium is provided, and the storage medium stores instructions, when the instructions are run on a computer, the rule engine-based order issuing control method as in the first aspect or any possible design of the first aspect is executed.
[0071] In a fifth aspect, a computer program product containing instructions which, when executed on a computer, cause the computer to perform the rule engine-based order issuing control method according to the first aspect or any possible design of the first aspect.
[0072] Advantages:
[0073] (1) The application extracts effective order information by automatically identifying order characteristics; then, according to preset rules, the order is classified and processed, that is, through three data pools of rejection issuing, instant issuing and plan issuing, and based on rule matching, the order pushed by the upstream system is stored in different data pools; finally, the order can be sequentially issued according to the push rules of different data pools; thus, compared with the traditional direct issuing of the order to the downstream system, the application realizes the classified push of the order, so that not only the flexibility of the order issuing is improved, but also the sequential issuing of the order is realized, thereby reducing the operation pressure of the downstream system and ensuring the stability of the system operation; at the same time, the whole process does not need manual intervention, improves the efficiency and reduces the error rate; therefore, the application is very suitable for large-scale application and promotion. BRIEF DESCRIPTION OF DRAWINGS
[0074] Figure 1 A step flowchart of the rule engine-based order issuing control method provided for the embodiment of the application is shown in the figure;
[0075] Figure 2 A structure diagram of the rule engine-based order issuing control device provided for the embodiment of the application is shown in the figure;
[0076] Figure 3 A structure diagram of the electronic device provided for the embodiment of the application is shown in the figure. DETAILED DESCRIPTION
[0077] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the application will be briefly introduced below in combination with the drawings and the description of the embodiments or the prior art. Obviously, the following description of the drawings is only some embodiments of the application, and for those skilled in the art, other drawings can also be obtained without creative labor. It should be noted that the description of these embodiments is used to help understand the application, but does not constitute a limitation on the application.
[0078] It should be understood that although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first element can be called a second element, and similarly, a second element can be called a first element, without departing from the scope of the example embodiments of the application.
[0079] It should be understood that, for the term "and / or" that can appear in the present text, it is only a description of the association relationship of the associated object, which means that there can be three relationships, for example, A and / or B, which can represent: the existence of A alone, the existence of B alone, and the existence of A and B simultaneously; for the term " / and" that can appear in the present text, it is another description of the relationship of another associated object, which means that there can be two relationships, for example, A / and B, which can represent: the existence of A alone, and the existence of A and B; in addition, for the character " / " that can appear in the present text, it generally represents an "or" relationship between the associated objects before and after it.
[0080] Embodiments:
[0081] Referring to Figure 1 As shown in the figure, the order issuing control method based on the rule engine provided by the embodiment extracts valid order information by automatically identifying order characteristics; then, the order is classified and processed according to the preset rules, that is, through three data pools of rejection issuing, instant issuing and planned issuing, and based on rule matching, the orders pushed by the upstream system are stored in different data pools; finally, the orders can be sequentially issued according to the push rules of different data pools; thus, compared with the traditional technology, the application realizes the classified push of the order, so that not only the flexibility of the order issuing is improved, but also the sequential issuing of the order is realized, thereby reducing the running pressure of the downstream system and ensuring the stability of the system operation; at the same time, the whole process does not need manual intervention, improves the efficiency and reduces the error rate; therefore, the method is very suitable for large-scale application and promotion; among them, the method can be but not limited to running at the order processing end side, optionally, the order processing end can be but not limited to using a server, it can be understood that the foregoing execution subject does not constitute a limitation on the embodiments of the present application, and correspondingly, the running steps of the method can be but not limited to the steps S1-S6 shown below.
[0082] S1. Obtain an order push command, wherein the order push command contains order data; in this embodiment, the order push command can be issued by an upstream system to an order processing end, for example, but not limited to, wherein the order data in the aforementioned order push command can include, but is not limited to, order number, order statistical information (total quantity, total amount, row number, etc.), payment information (payment amount, payment time, whether payment is delayed, etc.), discount information (total discount amount, total subsidy amount, etc.), customer information (customer name, contact person, delivery address, etc.), and other related information (such as order type, whether to add a specified delivery time, etc.); at the same time, the aforementioned order data can also include order details, such as product information (product number, product name, product unit price, product quantity, inventory type, etc.); in this way, after obtaining the order push command containing the order data, the order push command can be subjected to feature recognition, that is, extraction of effective information, so as to realize classification and delivery of orders according to the extracted effective information.
[0083] Among them, the feature recognition of the order data is mainly the extraction of keywords, the process is to first extract an order candidate keyword set; then, determine a plurality of order keywords from the order candidate keyword set; finally, based on the plurality of order keywords, the effective order information can be extracted from the order data; optionally, the extraction process of the candidate keywords can be, but not limited to, as shown in the following step S2.
[0084] S2. Adopt a word extraction algorithm based on global similarity and word similarity to extract candidate keywords from the order data in the order push command to obtain an order candidate keyword set; in specific application, this embodiment proposes a candidate keyword extraction algorithm that takes into account global semantic similarity while taking into account inter-word similarity, which can ensure the representativeness and diversity of the extracted candidate keywords.
[0085] Optionally, the extraction process of the aforementioned candidate keywords can be, but not limited to, as shown in the following steps S21-S27.
[0086] S21. Perform word segmentation processing on the order data to obtain a word segmentation set; in this embodiment, the order data can be subjected to word segmentation processing by using a jieba word segmentation tool, for example, but not limited to, and then stop words are removed; finally, a word segmentation set can be obtained; in this way, after obtaining the word segmentation set, a word extraction algorithm based on global similarity and word similarity can be used to iteratively select candidate keywords, the process of which is shown in the following steps S22-S27.
[0087] S22. Obtain an initial candidate word set and a candidate word set at the kth iteration, wherein when k is 1, the initial candidate word set at the kth iteration contains a target word, the candidate word set at the kth iteration is the segmentation set after removing the target word, and the target word is the word in the segmentation set that has the highest similarity with the order data.
[0088] In this embodiment, first, each word in the segmentation set and the order data are vector mapped to obtain a word vector corresponding to each word and a text vector corresponding to the order data. Then, the similarity between each word vector and the text vector is calculated, and the word corresponding to the word vector with the highest similarity is selected as the target word. Then, the initial candidate word set and the candidate word set are initialized as empty sets. Thus, in the first iteration, the target word can be added to the initial candidate word set, thereby obtaining the initial candidate word set at the first iteration. Similarly, the target word is removed from the segmentation set, and the remaining words are placed in the initialized candidate word set, thereby obtaining the candidate word set at the first iteration. Of course, the initial value of k is 1.
[0089] Further, for example but not limited to, the order data is input into the pre-trained BERT model to generate a vector representation corresponding to the order data, that is, a text vector. Similarly, each word in the segmentation set is input into the BERT model to generate a word vector corresponding to each word.
[0090] After obtaining the initial candidate word set and the candidate word set at the kth iteration, it can be determined whether the iteration stopping condition is met, and the process is shown in the following step S23.
[0091] S23. Determine whether the iteration stopping condition is met, wherein the iteration stopping condition is that the total number of words in the initial candidate word set at the kth iteration reaches a preset threshold. In specific applications, for example, the number of order candidate keywords, that is, the aforementioned preset threshold, can be determined by the number of words in the segmentation set, such as taking 30% to 50% of the total number of words in the segmentation set as the preset threshold. Of course, the value can be set according to actual use, which is not limited to the aforementioned example.
[0092] In this embodiment, when the aforementioned iteration stopping condition is not met, the initial candidate word set at the kth iteration and the order data are used to calculate the inter-word similarity and the global similarity, so that a order candidate keyword is determined from the candidate word set at the current iteration based on this. The calculation process of the global similarity and the inter-word similarity can be but not limited to the following step S24.
[0093] S24. If not, for any candidate word in the candidate word set in the kth iteration, calculate the global similarity between the any candidate word and the order data, and the inter-word similarity between the any candidate word and each initial candidate word in the initial candidate word set in the kth iteration; in a specific application, as previously described, the words in the word set and the order data have been represented by vectors; therefore, the cosine similarity between the word vector of the any candidate word and the text vector corresponding to the order data can be directly calculated as the global similarity of the any candidate word; similarly, the cosine similarity between the word vector of the any candidate word and the word vector of each initial candidate word in the kth iteration is calculated as the inter-word similarity; thus, after the global similarity and the inter-word similarity are calculated, the candidate score of the any candidate word can be calculated, the process of which is shown in the following step S25.
[0094] S25. According to the global similarity and the inter-word similarity, the candidate score of the any candidate word is calculated, and after all the candidate words in the candidate word set are polled, the candidate scores of the candidate words are obtained; in a specific implementation, for example, but not limited to, the maximum inter-word similarity is first selected from the inter-word similarity; then, a first hyperparameter (which is between 0 and 1) is obtained, and the difference between the hyperparameter threshold (which is 1) and the first hyperparameter is calculated to obtain a second hyperparameter; then, the first hyperparameter is multiplied by the global similarity, and the second hyperparameter is multiplied by the maximum inter-word similarity to obtain a first product and a second product, respectively; finally, the difference between the first product and the second product is calculated, so that the difference calculated above is taken as the candidate score of the any candidate word.
[0095] Thus, after the candidate scores of the candidate words in the candidate word set in the kth iteration are obtained by the foregoing calculation method, the order candidate keywords in this iteration are selected according to the candidate scores, the process of which is shown in the following step S26.
[0096] S26. Add the candidate word with the highest candidate score to the initial candidate word set in the kth iteration to obtain the initial candidate word set in the (k+1)th iteration, and delete the candidate word with the highest candidate score from the candidate word set to obtain the candidate word set in the (k+1)th iteration; in a specific application, the candidate word with the highest candidate score is an order candidate keyword determined in this iteration, so it can be added to the initial candidate word set in the kth iteration to update the initial candidate word set as the initial candidate word set in the next iteration; similarly, after selecting the order candidate keyword in this iteration, the word needs to be deleted from the candidate word set in the kth iteration to update the candidate word set, that is, to obtain the candidate word set in the next iteration; based on this, after updating the initial candidate word set and the candidate word set, the foregoing iteration process can be repeatedly executed until the iteration stop condition is met, and then the candidate words in the initial candidate word set can be used as order candidate keywords, and the iteration process is shown in the following step S27.
[0097] S27. Increase k by 1, and reacquire the initial candidate word set and the candidate word set in the kth iteration, and until the iteration stop condition is met, use the initial candidate word set that meets the iteration stop condition as the order candidate keyword set.
[0098] Therefore, by the foregoing steps S21-S27, the embodiment increases the calculation of the cosine similarity between segmented words compared with the method of calculating the similarity between the candidate word and the document in the prior art, so that the global semantic similarity is considered while the word similarity is also taken into account; based on this, the greater the similarity between the candidate words and the selected words is, the more the global similarity is weakened, and the influence of the key word redundancy problem is reduced to the greatest extent; therefore, when the similarity between the candidate words and the document is higher and the similarity between the candidate words is lower, the diversity of the extracted candidate keywords is higher, and this method not only improves the representativeness of the candidate keywords, but also effectively reduces the repetition and enhances the quality of the extraction result.
[0099] After the order candidate keyword set is extracted, an order keyword needs to be determined from the order candidate keyword set; wherein, the embodiment comprehensively measures the importance score of each order candidate keyword relative to the order data from three aspects of word importance, word attention and word relevance, wherein the calculation process of the foregoing word importance, word attention and word relevance can be but is not limited to the following step S3.
[0100] S3. Calculate the word importance, word attention and word relevance of each order candidate keyword in the order candidate keyword set, and calculate the importance score of each order candidate keyword relative to the order data according to the word importance, word attention and word relevance of each order candidate keyword.
[0101] In the embodiment, a calculation manner of word importance is provided first, which is described by taking any order candidate keyword as an example. The calculation process can be, but is not limited to, as shown in the following steps S31-S38.
[0102] S31. For any order candidate keyword, the word weight of the order candidate keyword is calculated. In the specific application, the word weight is introduced when calculating the word importance in the embodiment, which mainly considers the features such as word position, part of speech, and word length. Specifically, the calculation process can be, but is not limited to, as shown in the following steps S31a-S31f.
[0103] S31a. From the order data, the occurrence position of the order candidate keyword and the part of speech of the order candidate keyword at each occurrence position are determined. In the embodiment, after the occurrence position of the order candidate keyword and the part of speech at each occurrence position are determined, the position feature can be calculated according to the occurrence position, and the part of speech feature can be calculated according to the part of speech at each occurrence position. The calculation process of the position feature is shown in the following steps S31b and S31c.
[0104] S31b. According to the occurrence position of the order candidate keyword, the position weight of the order candidate keyword is calculated. In the specific implementation, for example, the position weight of the order candidate keyword can be calculated by using the following formula (1).
[0105] (1)
[0106] In formula (1), represents the position weight of the order candidate keyword, represents the mth occurrence position of the order candidate keyword, is the total number of occurrence positions. For example, the occurrence positions are the 2nd character, the 6th character, and the 10th character in the order data, then, are 2, 6, and 10 respectively, and is 3. Thus, the position weight of the order candidate keyword can be obtained by substituting the above data into formula (1). Of course, when the occurrence positions are different, the calculation manner is the same as the above example, which is not described here.
[0107] After the position weight is obtained, the position feature can be calculated based on the position weight, and the process is shown in the following step S31c.
[0108] S31c. Based on the position weight, the position feature of the any order candidate keyword is calculated; in a specific implementation, for example, but not limited to, the following formula (2) can be used to calculate the position feature.
[0109] (2)
[0110] In formula (2), denotes the position feature of the any order candidate keyword, denotes the position weight of the jth order candidate keyword in the order candidate keyword set, denotes the total number of order candidate keywords.
[0111] Thus, based on the foregoing formula (2), the position feature of the any order candidate keyword is calculated, and then the part-of-speech feature is calculated, the process of which is shown in the following step S31d.
[0112] S31d. The part-of-speech feature of the any order candidate keyword is calculated using the part-of-speech of the any order candidate keyword at each occurrence position.
[0113] In this embodiment, for example, but not limited to, the following formula (3) can be used to calculate the part-of-speech feature.
[0114] (3)
[0115] In formula (3), denotes the part-of-speech feature of the any order candidate keyword, denotes the mapping value corresponding to the part-of-speech of the any order candidate keyword at the mth occurrence position, denotes the total number of part-of-speech categories; in a specific application, for example, the part-of-speech categories mainly include verbs, nouns, adjectives, and other part-of-speech categories except the aforementioned three categories, wherein the mapping value of the verb is 4, the mapping value of the noun is 3, the mapping value of the adjective is 2, and the mapping value of the other part-of-speech is 1.
[0116] Thus, based on the foregoing formula (3), the part-of-speech feature of the any order candidate keyword can be calculated, and then the word length feature can be calculated, the process of which is shown in the following step S31e.
[0117] S31e. Calculate the average word length of all order candidate keywords in the order candidate keyword set, and calculate the word length feature of any order candidate keyword according to the word length of the order candidate keyword and the average word length; in specific implementation, for example, but not limited to, the ratio of the word length of the order candidate keyword to the average word length can be used as the word length feature of the order candidate keyword, that is, the candidate keyword is too short to reflect the information contained, and the more information contained, the longer the candidate keyword can be further divided, therefore, the embodiment introduces the word length feature to measure the influence of the word length on the extraction of the candidate keyword.
[0118] After obtaining the word length feature, the word weight of the order candidate keyword can be calculated by combining the position feature and the part-of-speech feature, as shown in the following step S31f.
[0119] S31f. Calculate the word weight of the order candidate keyword by using the position feature, the part-of-speech feature and the word length feature of the order candidate keyword; in the embodiment, the position feature, the part-of-speech feature and the word length feature are multiplied by respective weight coefficients and summed to obtain the word weight; wherein, for example, the weight coefficients of the three are 0.6, 0.3 and 0.1 respectively.
[0120] Thus, after calculating the word weight of the order candidate keyword by the foregoing steps S31a-S31f, the calculation of the term frequency feature value and the inverse document frequency feature value can be performed, as shown in the following steps S32-S37.
[0121] S32. Count the occurrence frequency of the order candidate keyword in the order data; after counting the occurrence frequency of the order candidate keyword, the historical orders containing the most order keywords and the least order keywords can be screened from the corpus, that is, the historical order database, so as to calculate the term frequency feature value based thereon; wherein, the calculation process of the historical order and the term frequency feature value is shown in the following steps S33 and S34.
[0122] S33. Obtain the historical order database, and screen the first historical order containing the most order keywords and the second historical order containing the least order keywords from the historical order database.
[0123] S34. Calculate the term frequency feature value of the any order candidate keyword according to the occurrence frequency, the total number of order keywords of the first historical order and the total number of order keywords of the second historical order; in specific implementation, this embodiment is to first map the term frequency feature according to the occurrence frequency, and then calculate the term frequency feature value in combination with the total number of order keywords of the two historical orders; wherein, the calculation process is as shown in the following steps S34a-S34d.
[0124] S34a. Calculate the initial term frequency feature value of the any order candidate keyword according to the occurrence frequency; in specific application, the term frequency feature mapping of the occurrence frequency is to make the occurrence frequency correspond to a feature value, so that the any order candidate keyword corresponds to a feature value, thereby facilitating the calculation of the subsequent term frequency feature.
[0125] Optionally, the initial term frequency feature value can be calculated by using the following formula (4) for example but not limited to.
[0126] (4)
[0127] In formula (4), denotes the initial term frequency feature value, denotes the occurrence frequency of the any order candidate keyword, is a term frequency parameter, and the value is 20.
[0128] Therefore, after calculating the initial term frequency feature value, the term frequency feature value can be calculated in combination with the total number of order keywords of the two determined historical orders, and the process is as shown in the following steps S34b-S34d.
[0129] S34b. Calculate the first term frequency intermediate parameter based on the occurrence frequency and the total number of order keywords of the first historical order, and calculate the second term frequency intermediate parameter based on the occurrence frequency and the total number of order keywords of the second historical order; in specific application, for example but not limited to, the total number of order keywords of the first historical order is added by 1 to obtain an addition result; then, the ratio between the occurrence frequency and the addition result is taken as the first term frequency intermediate parameter; similarly, the calculation process of the second term frequency intermediate parameter is the same as that of the first term frequency intermediate parameter, and will not be described here.
[0130] After calculating the two term frequency intermediate parameters, the third term frequency intermediate parameter can be calculated therefrom, and the process is as shown in the following step S34c.
[0131] S34c. Sum the first word frequency intermediate parameter and the second word frequency intermediate parameter to obtain a third word frequency intermediate parameter; after obtaining the third word frequency intermediate parameter, the final word frequency characteristic value can be calculated in combination with the word frequency control factor and the initial word frequency characteristic value, and the process is shown in the following step S34d.
[0132] S34d. Obtain the word frequency control factor, and calculate the word frequency characteristic value by using the word frequency control factor, the initial word frequency characteristic value and the third word frequency intermediate parameter; in specific application, for example, but not limited to, the product of the word frequency control factor and the third word frequency intermediate parameter is calculated first, then the sum of the product and the word frequency control factor is calculated; finally, the sum result is multiplied by the initial word frequency characteristic value to obtain the word frequency characteristic value.
[0133] Thus, through the foregoing steps S34a-S34d, when calculating the word frequency characteristic value, the embodiment performs mapping of the occurrence frequency, and simultaneously introduces the maximum order keyword total number and the minimum order keyword total number; thus, the double normalization processing of the word frequency characteristic value is performed by using the foregoing maximum and minimum order keyword total numbers, which can better process the frequency difference of the keywords and avoid the excessive influence of long text on the weight; after calculating the word frequency characteristic value, the reverse document characteristic value can be calculated, and the process is shown in the following steps S35-S37.
[0134] S35. From the historical order database, the total number of historical orders containing the any order candidate keyword is counted, and the occurrence number of the any order candidate keyword in each historical order in the historical order database is counted.
[0135] S36. The maximum occurrence number and the minimum occurrence number are selected from each occurrence number; after counting the occurrence number of the any order candidate keyword in each historical order and selecting the maximum occurrence number and the minimum occurrence number of the any order candidate keyword, the reverse document characteristic value of the any order candidate keyword can be calculated, and the process is shown in the following step S37.
[0136] S37. According to the total number, the maximum number of occurrences and the minimum number of occurrences, the inverse document feature value of the any order candidate keyword is calculated; in this embodiment, the maximum number of occurrences is used to calculate the maximum inverse document feature value, wherein the maximum number of occurrences is multiplied by the total number to obtain a first inverse document parameter; then, the total number plus 1 is used to obtain a second inverse document parameter (which functions to prevent the denominator from being 0); then, the ratio of the first inverse document parameter to the second inverse document parameter is taken as the maximum inverse document feature value; similarly, the minimum number of occurrences is used to calculate the minimum inverse document feature value (the calculation process is the same as that of the maximum inverse document feature value); finally, the average of the sum of the maximum inverse document feature value and the minimum inverse document feature value is taken as the inverse document feature value of the any order candidate keyword.
[0137] In this way, by introducing the maximum and minimum inverse document feature values to verify the inverse document feature value, it is possible to prevent rare candidate words from being assigned a high weight, thereby causing deviation in keyword extraction.
[0138] After obtaining the term frequency feature value and the inverse document feature value of the any order candidate keyword, the term importance of the any order candidate keyword can be calculated in combination with the term weight, and the calculation process is shown in the following step S38.
[0139] S38. Based on the term frequency feature value, the inverse document feature value and the term weight, the term importance of the any order candidate keyword is calculated; in specific implementation, for example, but not limited to, the following formula (5) can be used to calculate the term importance.
[0140] (5)
[0141] In the above formula (5), denotes the term importance of the any order candidate keyword, denotes the term weight, the term frequency feature value and the inverse document feature value of the any order candidate keyword in turn.
[0142] In this way, after the term importance of the any order candidate keyword is calculated through the foregoing steps S31-S38, the calculation of the term attention degree can be performed, and the process is shown in the following steps S39-S315.
[0143] S39. The attention weight matrix of all order candidate keywords in the order candidate keyword set is extracted by using the self-attention mechanism, wherein the size of the attention weight matrix is , This represents the number of tokens corresponding to the order candidate keyword set, and each order candidate keyword consists of at least one token. In practical applications, although the importance and relevance of keywords and documents are usually considered together, it is difficult to comprehensively distinguish the quality of order candidate keywords using only these features. Therefore, this embodiment introduces a self-attention mechanism to solve the anisotropy problem among candidate keywords, thereby better identifying order keywords. Specifically, this embodiment uses the BERT-base model to generate the attention weights of order candidate keywords. Specifically, the entire order candidate keyword set is used as input data and input into the BERT-base model. Then, the average attention value of each head in the last layer of the self-attention set of the model is extracted to generate the attention weight matrix of the order candidate keyword set.
[0144] In this embodiment, a token is the smallest unit of text processing in Natural Language Processing (NLP), which usually corresponds to a word, punctuation mark or other language element. That is, before processing the order candidate keyword set, the BERT-base model will tokenize it, that is, divide each order candidate keyword set into multiple tokens; for example, the order amount can be divided into two tokens: "order" and "amount".
[0145] Thus, after obtaining the attention weight matrix of the order candidate keywords, the attention level of each token can be calculated based on this matrix, as shown in step S310 below.
[0146] S310. Calculate the attention value of each token based on the attention weight matrix. In this embodiment, each column of the attention weight matrix corresponds to a token. Therefore, by summing each column of the attention weight matrix, the attention value of each token can be obtained. Then, the attention value of each token can be used to construct the attention matrix, as shown in step S311 below.
[0147] S311. Construct an attention matrix using the attention value of each token; in this embodiment, this is equivalent to constructing a... The matrix is used as the attention matrix.
[0148] After obtaining the attention matrix, the attention weight matrix can be combined to generate the word association matrix, as shown in step S312 below.
[0149] S312. Based on the attention matrix and the attention weight matrix, an inter-word association matrix is generated; in specific implementation, for example, but not limited to, the attention matrix is first normalized, and then the normalized attention matrix is multiplied with the attention weight matrix to obtain the inter-word association matrix; after obtaining the inter-word association matrix, the association value of each token can be obtained based on the inter-word association matrix, and the process is shown in the following step S313.
[0150] S313. According to the inter-word association matrix, the association value of each token is calculated; in this embodiment, the inter-word association matrix is also a matrix, and each element in the matrix corresponds to a token, so each element of the inter-word association matrix corresponds to the association value between a token and all other tokens.
[0151] Thus, after obtaining the association value of each token, the actual attention degree of each token can be calculated, and the process is shown in the following step S314.
[0152] S314. The actual attention degree of each token is calculated using the attention degree value and the association value of each token; in this embodiment, the actual attention degree of each token is obtained by summing the attention degree value and the association value of each token; then, the word attention degree of any order candidate keyword can be calculated based on this, and the process is shown in the following step S315.
[0153] S315. For any order candidate keyword, all tokens constituting the any order candidate keyword are determined, and the word attention degree of the any order candidate keyword is calculated using the actual attention degrees of all tokens constituting the any order candidate keyword; in this embodiment, the word attention degree of the any order candidate keyword is obtained by summing the actual attention degrees of all tokens constituting the any order candidate keyword.
[0154] Thus, after calculating the word attention degree of the any order candidate keyword through the foregoing steps S39-S315, the calculation of word relevance can be performed, and the process is shown in the following steps S316-S320.
[0155] S316. For any order candidate keyword, the co-occurrence probability between the any order candidate keyword and each specified word in a specified word set is calculated, wherein the specified word set contains each order candidate keyword in the order candidate keyword set except the any order candidate keyword.
[0156] In the embodiment, the order data can be traversed to count the number of times that any order candidate keyword and any specified word appear simultaneously. For example, the number of times that any order candidate keyword and any specified word appear simultaneously within a certain range (e.g., a sentence) can be counted using a sliding window method; then, the counted number of simultaneous appearances is divided by the total number of word pair combinations in all sliding windows (i.e., the number of combinations of selecting 2 word items from all word items in the window), thereby obtaining the co-occurrence probability between the any order candidate keyword and the any specified word; of course, the calculation process of the co-occurrence probability between the any order candidate keyword and the remaining specified words is the same, which is not described herein.
[0157] After obtaining the co-occurrence probability, the appearance probability of the any order candidate keyword and each specified word can be calculated, the process of which is shown in the following step S317.
[0158] S317. Calculate the appearance probability of the any order candidate keyword and the appearance probability of each specified word; in the embodiment, the appearance frequency of the any order candidate keyword in the order data is divided by the total number of word items in the order data to obtain the appearance probability of the any order candidate keyword; of course, the calculation process of the appearance probability of each specified word is the same, which is not described herein.
[0159] After obtaining the appearance probability of the any order candidate keyword and the appearance probability of each specified word, the correlation decay factor can be calculated, the process of which is shown in the following step S318.
[0160] S318. Determine the correlation decay factor between the any order candidate keyword and each specified word; in specific implementation, for example, but not limited to, the average co-occurrence interval between the any order candidate keyword and any specified word is obtained, that is, when the any order candidate keyword and the any specified word appear in the same window, the number of interval words; then, the average of all interval numbers is taken as the average co-occurrence interval; then, the average co-occurrence interval is added by 1 (to prevent the denominator from being 0) to obtain the actual average co-occurrence interval; finally, the ratio between 1 and the actual average co-occurrence interval is taken as the correlation decay factor between the any order candidate keyword and any specified word; in this way, the smaller the interval between the two, the higher the correlation.
[0161] After calculating the correlation decay factor between the any order candidate keyword and each specified word, the word attention between the any order candidate keyword and each specified word can be calculated in combination with the aforementioned co-occurrence probability and appearance probability, the calculation process of which is shown in the following step S319.
[0162] S319. Calculate the word relevance between the any order candidate keyword and each specified keyword according to the co-occurrence probability between the any order candidate keyword and each specified keyword, the occurrence probability of the any order candidate keyword, the occurrence probability of each specified keyword, and the relevance decay factor between the any order candidate keyword and each specified keyword.
[0163] In a specific application, for example, but not limited to, the following formula (6) is used to calculate the word relevance between the any order candidate keyword and the any specified keyword.
[0164] (6)
[0165] In the above formula (6), denotes the word relevance between the any order candidate keyword and the any specified keyword, is the co-occurrence probability between the any order candidate keyword and the any specified keyword, denote the occurrence probability of the any order candidate keyword and the occurrence probability of the any specified keyword, respectively, denotes the relevance decay factor between the any order candidate keyword and the any specified keyword.
[0166] Thus, using the aforementioned formula (6), the word relevance between the any order candidate keyword and each of the remaining specified keywords can be calculated. Then, based on this, the word relevance of the any order candidate keyword can be calculated as shown in the following step S320.
[0167] S320. Calculate the word relevance of the any order candidate keyword using the word relevance between the any order candidate keyword and each specified keyword; in this embodiment, the average of the word relevance between the any order candidate keyword and each specified keyword is taken as the word relevance of the any order candidate keyword.
[0168] After calculating the word importance, word attention, and word relevance of each order candidate keyword through the aforementioned steps S31-S320, the importance score of each order candidate keyword relative to the order data can be calculated based on this; specifically, the product of the word importance, word attention, and word relevance of each order candidate keyword is taken as the importance score of each order candidate keyword; then, the final order keyword can be selected according to the importance score, and the selection process is shown in the following step S4.
[0169] S4. Determine a number of order keywords from the order candidate keyword set according to the importance score of each order candidate keyword; in this embodiment, sort the order candidate keywords in descending order of importance score, and then take the top B as order keywords, where B is the total sum of data used in subsequent order rule matching, such as order number, delivery address, payment information, other related information, order amount, customer information, order type, etc. Therefore, the number of B is 7. Of course, the foregoing example is only an example, and the present embodiment is not limited thereto.
[0170] After obtaining a number of order keywords, the effective order information can be extracted, and the process is shown in the following step S5.
[0171] S5. Determine effective order information from the order data based on a number of order keywords; in this embodiment, extract the content corresponding to each order keyword from the order data, such as order number: xxxxx23, delivery address: xxx city xx district xx number, payment information: xxxxx, etc. Then, extract the content actually corresponding to the keywords such as order number, delivery address, payment information, other related information, order amount, customer information, order type, etc. to form effective order information.
[0172] After obtaining the effective order information, the rule engine can be used for rule matching to subsequently classify the order and push it to different data pools for delivery according to different push rules, and the process is shown in the following step S6.
[0173] S6. Use the rule engine to perform rule matching on the effective order information, and according to the rule matching result, push the order data to the reject delivery data pool, the immediate delivery data pool or the planned delivery data pool, so as to push the order data to the downstream system according to the push rules corresponding to the reject delivery data pool, the immediate delivery data pool or the planned delivery data pool; in this embodiment, before rule matching, data verification and cleaning can be performed, for example, but not limited to. The data verification includes, but is not limited to, null value verification of key data (such as amount, address), order number uniqueness verification, etc. The data cleaning includes, but is not limited to, contact address processing, order number processing, etc. Thus, after completing data cleaning and verification, rule matching can be performed, and the process is as follows:
[0174] If the order number in the valid order information belongs to the rejected order number and / or the delivery address in the valid order information belongs to the logistics super-region address (i.e. whether the delivery address is an address that the logistics cannot deliver), it is concluded that the rule matching result is to reject the issued order, and the order data is pushed to the rejected issued data pool; wherein, according to the order number in the valid order information, matching is performed in the rejected order table, and according to the delivery address of the valid order information, matching is performed in the logistics reachable address, so as to determine whether it is a rejected order number and a logistics super-region address; wherein, if yes, it is determined that the order is a rejected issued order.
[0175] Similarly, if there is a specified issued time and / or payment delay information in the valid order information, it is concluded that the rule matching result is a planned issued order, and the order data is pushed to the planned issued data pool.
[0176] Finally, if the order amount in the valid order information exceeds the preset amount, the order customer belongs to the specified customer and / or the order type belongs to the specified order type, it is concluded that the rule matching result is an immediate issued order, and the order data is pushed to the immediate issued data pool, wherein the specified order type is a commercial allocation order, a platform direct allocation order or a first order; in this embodiment, the order customer (i.e. customer information) in the valid order information is matched with the pre-stored specified customer table (which records the names of large customers) to determine whether the order customer belongs to the specified customer, and according to the order type in the valid order information, it is determined whether it is a commercial allocation order, a platform direct allocation order or a first order (the first order can match the customer with the historical customer, if the matching is not successful, it is determined to be a first order); in this way, when the above rules are met, it is determined that the order belongs to the immediate issued order, which needs to be pushed to the immediate issued data pool.
[0177] In this way, when pushed to the rejected issued data pool, the corresponding pushing rule is to stop pushing; at the same time, the orders in the rejected issued data pool automatically start the pushing command at 0 o'clock and 12 o'clock every day, re-perform rule matching, or manually issue.
[0178] Similarly, the pushing rule of the planned issued data pool is to automatically start the pushing command of the orders in the pool at the planned issued time; and the pushing rule of the immediate issued data pool is to directly push the orders in the pool to the downstream system.
[0179] Further, if the order does not match the above three rules, it is moved to the matching rule exception pool and an exception prompt is given to prompt the pushing personnel to manually process.
[0180] In addition, the example rule engine can also set different components to implement different rule matching. For example, after the OrderIssue component receives the command, the component performs feature recognition on the order data, and performs verification and cleaning on the extracted valid order information. Then, the component successively sends rule matching commands to the OrderIssue_Reject component, the OrderIssue_Pronto component, and the OrderIssue_Plan component, and performs different processing according to different results. That is, the OrderIssue_Reject component performs matching of a rejection rule, the OrderIssue_Pronto component performs matching of an instant rule, and the OrderIssue_Plan component performs matching of a plan rule. In this way, different rules can be matched, and orders can be classified into different types of data pools to achieve orderly order delivery.
[0181] In the embodiment, if the extracted valid order information is missing the content required for rule matching, keyword expansion is required. That is, on the basis of the extracted keywords, keywords are continuously selected from the order candidate keyword set until the content extracted by the selected keywords covers the comprehensive content required for rule matching.
[0182] According to the order delivery control method based on the rule engine described in detail in the foregoing steps S1-S6, the application realizes classification and push of orders. In this way, the flexibility of order delivery is improved, and orderly order delivery is achieved, thereby reducing the operation pressure of the downstream system and ensuring the stability of system operation. At the same time, the entire process does not require manual intervention, thereby improving efficiency and reducing error rate. Therefore, the application is very suitable for large-scale application and promotion.
[0183] As shown in FIG. 7, the second aspect of the embodiment provides a hardware device for implementing the order delivery control method based on the rule engine described in the first aspect of the embodiment, which comprises: Figure 2 An acquisition unit is configured to acquire an order push command, wherein the order push command contains order data.
[0184] A candidate keyword extraction unit is configured to extract candidate keywords from the order data in the order push command by using a keyword extraction algorithm based on global similarity and word similarity to obtain an order candidate keyword set.
[0185]
[0186] The keyword extraction unit is configured to calculate the word importance, word attention, and word relevance of each order candidate keyword in the order candidate keyword set, and calculate an importance score of each order candidate keyword relative to the order data according to the word importance, word attention, and word relevance of each order candidate keyword.
[0187] The keyword extraction unit is further configured to determine a plurality of order keywords from the order candidate keyword set according to the importance scores of the order candidate keywords.
[0188] The order information extraction unit is configured to determine valid order information from the order data based on the plurality of order keywords.
[0189] The order issuing unit is configured to perform rule matching on the valid order information by using a rule engine, and push the order data to a rejection issuing data pool, an instant issuing data pool, or a plan issuing data pool according to a rule matching result, so as to push the order data to a downstream system according to a pushing rule corresponding to the rejection issuing data pool, the instant issuing data pool, or the plan issuing data pool.
[0190] The working process, working details, and technical effects of the device provided in this embodiment can be referred to the first aspect of the embodiment, and will not be repeated here.
[0191] As shown in Figure 3 The third aspect of the embodiment provides another order issuing control device based on a rule engine. Taking an electronic device as an example, the device comprises a memory, a processor, and a transceiver connected in sequence, wherein the memory is configured to store a computer program, the transceiver is configured to receive and send messages, and the processor is configured to read the computer program and execute the order issuing control method based on a rule engine as described in the first aspect of the embodiment.
[0192] For example, the memory can include, but is not limited to, random access memory (RAM), read only memory (ROM), flash memory, first input first output (FIFO) memory, first in last out (FILO) memory, and the like; specifically, the processor can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array), and the processor can also include a main processor and a co-processor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit); the co-processor is a low-power processor for processing data in a standby state.
[0193] In some embodiments, the processor can be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content required to be displayed on the display screen. For example, the processor can be, but is not limited to, a microprocessor of the STM32F105 series, a RISC (reduced instruction set computer) microprocessor, an X86 architecture processor, or a processor integrated with an embedded neural network processing unit (NPU); the transceiver can be, but is not limited to, a WIFI wireless transceiver, a Bluetooth wireless transceiver, a GPRS (General Packet Radio Service) wireless transceiver, a ZigBee wireless transceiver, a 3G transceiver, a 4G transceiver, and / or a 5G transceiver, and the like. In addition, the device can also include, but is not limited to, a power module, a display screen, and other necessary components.
[0194] The working process, working details, and technical effects of the electronic device provided in the embodiment can be referred to the first aspect of the embodiment, and will not be repeated here.
[0195] The fourth aspect of the embodiment provides a storage medium storing instructions of the rule engine-based order issuing control method in the first aspect of the embodiment, that is, the storage medium stores the instructions, and when the instructions run on a computer, the rule engine-based order issuing control method in the first aspect of the embodiment is executed.
[0196] The storage medium refers to a carrier for storing data, which can include, but is not limited to, a floppy disk, an optical disk, a hard disk, a flash memory, a USB flash disk, a memory stick and the like, and the computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices.
[0197] The working process, working details and technical effects of the storage medium provided by the embodiment can be referred to the first aspect of the embodiment, and will not be described here.
[0198] The fifth aspect of the embodiment provides a computer program product containing instructions, which, when running on a computer, causes the computer to execute the rule engine-based order issuing control method in the first aspect of the embodiment, wherein the computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable devices.
[0199] Finally, it should be noted that: the above only describes the preferred embodiments of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A rule engine based order issuing control method, characterized by, The method comprises the following steps: an order push command is acquired, wherein the order push command contains order data; a keyword extraction algorithm based on global similarity and word similarity is used to extract candidate keywords from the order data in the order push command to obtain an order candidate keyword set, wherein the order candidate keyword set is obtained in the following manner: the order data is subjected to word segmentation processing to obtain a word segmentation set; an initial candidate keyword set and a candidate keyword set at the kth iteration are acquired, wherein when k is 1, the initial candidate keyword set at the kth iteration contains a target word, the candidate keyword set at the kth iteration is the word segmentation set after the target word is removed, and the target word is the word in the word segmentation set that has the highest similarity with the order data; it is determined whether an iteration stop condition is met, wherein the iteration stop condition is that the total number of keywords in the initial candidate keyword set at the kth iteration reaches a preset threshold; if not, the global similarity between any candidate keyword in the candidate keyword set at the kth iteration and the order data, and the inter-word similarity between the any candidate keyword and each initial candidate keyword in the initial candidate keyword set at the kth iteration are calculated, wherein the cosine similarity between the word vector of the any candidate keyword and the text vector corresponding to the order data is taken as the global similarity of the any candidate keyword, and the cosine similarity between the word vector of the any candidate keyword and the word vector of each initial candidate keyword at the kth iteration is taken as the inter-word similarity; the candidate score of the any candidate keyword is calculated according to the global similarity and the inter-word similarity, and the candidate scores of all candidate keywords in the candidate keyword set are obtained after all the candidate keywords are polled; the candidate keyword with the highest candidate score is added to the initial candidate keyword set at the kth iteration to obtain the initial candidate keyword set at the (k+1)th iteration, and the candidate keyword with the highest candidate score is deleted from the candidate keyword set to obtain the candidate keyword set at the (k+1)th iteration; k is increased by 1, and the initial candidate keyword set and the candidate keyword set at the kth iteration are re-acquired until the iteration stop condition is met, and the initial candidate keyword set that meets the iteration stop condition is taken as the order candidate keyword set; the word importance, the word attention and the word relevance of each order candidate keyword in the order candidate keyword set are calculated, and the importance score of each order candidate keyword relative to the order data is calculated according to the word importance, the word attention and the word relevance of each order candidate keyword; a number of order keywords are determined from the order candidate keyword set according to the importance score of each order candidate keyword; effective order information is determined from the order data based on the number of order keywords; a rule engine is used to perform rule matching on the effective order information, and according to the rule matching result, the order data is pushed to a rejection delivery data pool, an instant delivery data pool or a plan delivery data pool, so that the order data is pushed to a downstream system according to the push rules corresponding to the rejection delivery data pool, the instant delivery data pool or the plan delivery data pool. The word importance of each order candidate keyword in the order candidate keyword set is calculated, including: For any order candidate keyword, the word weight of the order candidate keyword is calculated; The frequency of occurrence of the order candidate keyword in the order data is counted; A historical order database is obtained, and a first historical order containing the most order keywords and a second historical order containing the least order keywords are filtered from the historical order database; According to the frequency of occurrence, the total number of order keywords of the first historical order, and the total number of order keywords of the second historical order, the term frequency characteristic value of the order candidate keyword is calculated; From the historical order database, the total number of historical orders containing the order candidate keyword is counted, and the number of occurrences of the order candidate keyword in each historical order in the historical order database is counted; The maximum number of occurrences and the minimum number of occurrences are filtered from each number of occurrences; According to the total number, the maximum number of occurrences, and the minimum number of occurrences, the inverse document characteristic value of the order candidate keyword is calculated; Based on the term frequency characteristic value, the inverse document characteristic value, and the word weight, the word importance of the order candidate keyword is calculated; The word attention of each order candidate keyword in the order candidate keyword set is calculated, including: The self-attention mechanism is used to extract an attention weight matrix of all order candidate keywords in the order candidate keyword set, wherein the size of the attention weight matrix is , , indicates the number of tokens corresponding to the order candidate keyword set, and any order candidate keyword is composed of at least one token. According to the attention weight matrix, the attention value of each token is calculated; Using the attention value of each token, an attention matrix is constructed; Based on the attention matrix and the attention weight matrix, an inter-word association matrix is generated; According to the inter-word association matrix, the association value of each token is calculated; Using the attention value and the association value of each token, the actual attention of each token is calculated; For any order candidate keyword, all tokens constituting the order candidate keyword are determined, and the word attention of the order candidate keyword is calculated using the actual attention of all tokens constituting the order candidate keyword. The word relevance of each order candidate keyword in the order candidate keyword set is calculated, including: For any order candidate keyword, the co-occurrence probability between the order candidate keyword and each specified word in a specified word set is calculated, wherein the specified word set contains each order candidate keyword in the order candidate keyword set except the order candidate keyword; The occurrence probability of the order candidate keyword and the occurrence probability of each specified word are calculated; The relevance decay factor between the order candidate keyword and each specified word is determined; According to the co-occurrence probability between the order candidate keyword and each specified word, the occurrence probability of the order candidate keyword, the occurrence probability of each specified word, and the relevance decay factor between the order candidate keyword and each specified word, the word relevance between the order candidate keyword and each specified word is calculated; The word relevance of any order candidate keyword is calculated by using the word relevance between the order candidate keyword and each specified word.
2. The method of claim 1, wherein, The candidate score of any candidate word is calculated according to the global similarity and the word-to-word similarity, including: The maximum word-to-word similarity is selected from the word-to-word similarity. The first hyperparameter is obtained, and the difference between the hyperparameter threshold and the first hyperparameter is calculated to obtain the second hyperparameter, wherein the first hyperparameter is between 0 and 1. The first product and the second product are obtained by multiplying the first hyperparameter and the global similarity and multiplying the second hyperparameter and the maximum word-to-word similarity, respectively. The difference between the first product and the second product is calculated to obtain the candidate score of any candidate word.
3. The method of claim 1, wherein, The word weight of any order candidate keyword is calculated, including: The occurrence position of any order candidate keyword and the part of speech of any order candidate keyword at each occurrence position are determined from the order data. The position weight of any order candidate keyword is calculated according to the occurrence position of any order candidate keyword. The position feature of any order candidate keyword is calculated based on the position weight. The part of speech feature of any order candidate keyword is calculated by using the part of speech of any order candidate keyword at each occurrence position. The average word length of all order candidate keywords in the order candidate keyword set is calculated, and the word length feature of any order candidate keyword is calculated according to the word length of any order candidate keyword and the average word length. The word weight of any order candidate keyword is calculated by using the position feature, the part of speech feature and the word length feature of any order candidate keyword.
4. The method of claim 1, wherein, The term frequency feature value of any order candidate keyword is calculated according to the occurrence frequency, the total number of order keywords of the first historical order and the total number of order keywords of the second historical order, including: The initial term frequency feature value of any order candidate keyword is calculated according to the occurrence frequency. The first term frequency intermediate parameter is calculated based on the occurrence frequency and the total number of order keywords of the first historical order, and the second term frequency intermediate parameter is calculated based on the occurrence frequency and the total number of order keywords of the second historical order. The third term frequency intermediate parameter is obtained by summing the first term frequency intermediate parameter and the second term frequency intermediate parameter. The term frequency control factor is obtained, and the term frequency feature value is calculated by using the term frequency control factor, the initial term frequency feature value and the third term frequency intermediate parameter.
5. The method of claim 1, wherein, The effective order information is matched by using the rule engine, and the order data is pushed to the rejected delivery data pool, the immediate delivery data pool or the planned delivery data pool according to the rule matching result, including: If the order number in the effective order information belongs to the rejected order number and / or the delivery address in the effective order information belongs to the logistics super-region address, it is concluded that the rule matching result is to reject the delivery order, and the order data is pushed to the rejected delivery data pool. If the specified delivery time and / or payment delay information exist in the effective order information, a rule matching result is that the order is scheduled for delivery, and the order data is pushed to the scheduled delivery data pool; If the order amount in the effective order information exceeds the preset amount, the order customer belongs to the specified customer, and / or the order type belongs to the specified order type, a rule matching result is that the order is immediately delivered, and the order data is pushed to the immediate delivery data pool, wherein the specified order type is a commercial allocation order, a platform direct allocation order, or a first order.
6. A rule engine based order issuing control apparatus, characterized by, The device for executing the order delivery control method based on the rule engine of any one of claims 1-5, wherein the device comprises: An acquisition unit configured to acquire an order pushing command, wherein the order pushing command contains order data; A candidate keyword extraction unit configured to extract candidate keywords from the order data in the order pushing command by using a keyword extraction algorithm based on global similarity and word similarity, to obtain a set of order candidate keywords; A keyword extraction unit configured to calculate word importance, word attention, and word relevance of each order candidate keyword in the set of order candidate keywords, and calculate an importance score of each order candidate keyword relative to the order data based on the word importance, the word attention, and the word relevance of each order candidate keyword; The keyword extraction unit is further configured to determine a number of order keywords from the set of order candidate keywords based on the importance score of each order candidate keyword; An order information extraction unit configured to determine effective order information from the order data based on the number of order keywords; An order delivery unit configured to use a rule engine to perform rule matching on the effective order information, and push the order data to a rejected delivery data pool, an immediate delivery data pool, or a scheduled delivery data pool according to a rule matching result, so as to push the order data to a downstream system according to a pushing rule corresponding to the rejected delivery data pool, the immediate delivery data pool, or the scheduled delivery data pool.
7. An electronic device, comprising: Comprise: A memory, a processor, and a transceiver connected in sequence, wherein the memory is configured to store a computer program, the transceiver is configured to receive and send messages, and the processor is configured to read the computer program and execute the order delivery control method based on the rule engine of any one of claims 1-5.
Citation Information
Patent Citations
The invention discloses an aAutomatic keyword extraction method based on a universal gravitation model
CN109614626A
Data intelligent question and answer method and system fusing domain knowledge
CN118779438A