A rule engine-based order matching method and device and a rule engine
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]在实际的物流运输过程中,全网的订单数量巨大且物流运输的业务场景复杂,每一订单信息以及运输区域均可能存在特殊的运输要求,因此,容易造成物流异常的情况
1.规则引擎获取业务系统对应的多个规则信息,针对每一规则信息,从全量的分单信息中确定与规则信息对应的若干命中分单信息,并确定每一命中分单信息对应的订单信息,然后,将规则信息对应的每一命中分单信息、每一命中分单信息对应的订单信息、规则信息进行数据整合,并将所有整合数据发送至业务系统。规则引擎实时监控全网的分单信息,并基于各业务系统推送的多个规则信息进行分单信息的匹配,能够为不同业务场景对应的业务系统匹配出符合对应规则的分单信息,并将符合规则的分单信息进行整合后发送给对应的业务系统,以应对在物流运输中多种复杂业务场景的要求。
Smart Images

Figure CN116307980B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of logistics and transportation, and in particular to an order matching method, apparatus and rule engine based on a rule engine. Background Technology
[0002] With the rapid development of the logistics industry, people's lives have become much more convenient. However, various complex business scenarios exist in the actual process of logistics transportation, such as last-mile delivery failures, bank-to-postal transfers, false signatures, lost package tracking, and on-demand delivery. The bank-to-postal transfer scenario involves all express deliveries within a certain area being handled by the postal service. That is, when logistics arrive in this area, the order information needs to be transferred to the postal service for subsequent delivery.
[0003] In actual logistics and transportation processes, the number of orders across the network is enormous and the business scenarios of logistics and transportation are complex. Each order information and transportation area may have special transportation requirements, which can easily lead to logistics anomalies.
[0004] Therefore, there is an urgent need for a universal order matching method that can match order information that meets the corresponding rules according to different business scenarios, in order to meet the requirements of various complex business scenarios in logistics and transportation. Summary of the Invention
[0005] The purpose of this application is to provide an order matching method, apparatus, and rule engine based on a rule engine to solve at least one of the above-mentioned technical problems.
[0006] The above-mentioned inventive objective of this application is achieved through the following technical solutions: Firstly, this application provides an order matching method based on a rules engine, employing the following technical solution: A rule engine-based order matching method, the method comprising: Obtain multiple rule information corresponding to the business system. The rule information includes at least: rule segment code information and administrative division of the recipient address. Obtain all order information, where each order information includes: order segment code information and address information; For each rule information, determine several matching order information corresponding to the rule information from the full set of order information, and determine the order information corresponding to each matching order information; For each rule information, the data of each hit order information, the order information corresponding to each hit order information, and the rule information are integrated to obtain integrated data, and all integrated data are sent to the business system.
[0007] By adopting the above technical solution, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it identifies several matching order information from the full set of order information and determines the order information corresponding to each matching order information. Then, it integrates the data of each matching order information, the order information corresponding to each matching order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that meets the corresponding rules for business systems corresponding to different business scenarios, and then integrate the order information that meets the rules and send it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0008] In a preferred embodiment, this application can be further configured such that, before sending all integrated data to the business system, it also includes: Based on the basic business information, determine the notification type corresponding to the business system, wherein the basic business information includes at least the notification types corresponding to each of the multiple business systems; Accordingly, sending all integrated data to the business system includes: Using the notification type corresponding to the business system, all integrated data is sent to the business system.
[0009] By adopting the above technical solution, the notification type corresponding to the business system is determined based on the basic business information, and the integrated data is sent to the business system through this notification type. Sending integrated data based on the notification type corresponding to the business system can avoid the failure to send integrated data to the business system due to incorrect notification method.
[0010] In a preferred embodiment, this application can be further configured as follows: for each rule information, determining several hit order information corresponding to the rule information from the full set of order information includes: For each rule information, all segment code information of the full set of segment information is sequentially matched with the rule segment code information of the rule information, wherein the segment code information and the rule segment code information are determined based on the same address library version; If the segment code is successfully matched, the segment information with the successfully matched segment code is determined to be the hit segment information; If segment code matching fails, the address information and the administrative division of the recipient address in the rule information of the segment code matching failure will be matched. The address information and the administrative division of the recipient address are determined based on the same address database version. If the address matching is successful, the segment information with successful address matching is determined as the hit segment information. After completing the matching operation of all order information and rule information, several hit order information are obtained for each rule information.
[0011] By adopting the above technical solution, for each rule information, all segment codes of the full set of order information are sequentially matched with the rule segment codes of the rule information. If the segment code match is successful, the order information with the successful segment code match is determined as the hit order information. If the segment code match fails, the address information of the order information with the failed segment code match is matched with the administrative division of the recipient address in the rule information. If the address match is successful, the order information with the successful address match is determined as the hit order information. This process is iterated to obtain several hit order information for each rule information. The matching operation between order information and rule information is performed from both the segment code and address dimensions, and the same address database version is used for segment code division and address division, ensuring the accuracy of the matching results.
[0012] In a preferred example, this application can be further configured to: generate basic business information in the following ways, including: Obtain relevant information from each business system, including: business type, business name, notification type, and callback address; Verify that all relevant information conforms to the preset rules, and register all successfully verified relevant information into the business basic information.
[0013] By adopting the above technical solution, relevant information from each business system is obtained, all relevant information is verified to meet the preset rules, and all successfully verified relevant information is registered to the business basic information. In this way, it is ensured that all information in the business basic information meets the preset rules.
[0014] In a preferred embodiment, this application can be further configured such that the relevant information also includes: full throughput interface information. The method further includes: Every first preset time interval, a set of valid rule information is obtained from the business system based on the full throughput interface information; The effective rule information set is matched with the business rule information set corresponding to the business system to obtain the rule matching result; The business rule information set is updated based on the rule matching result, wherein multiple rule information corresponding to the business system can be obtained based on the business rule information set.
[0015] By adopting the above technical solution, at each first preset time interval, a valid rule information set is obtained from the business system based on the full throughput interface information. The valid rule information set is then matched with the corresponding business rule information set of the business system, and the business rule information set is updated based on the rule matching result. In this way, the rule engine keeps the rule information in the business system consistent, thereby improving the accuracy of the rule engine in matching orders based on the rule information.
[0016] In a preferred embodiment, this application can be further configured such that, before obtaining the multiple rule information corresponding to the business system, it also includes: Obtain the business rule information set and write the business rule information set into the cache; Accordingly, obtaining multiple rule information corresponding to the business system includes: Read multiple rule information corresponding to the business system from the cache.
[0017] By adopting the above technical solution, the business rule information set is written into the cache. When the rule engine matches the order information with the rule information, it directly reads the business rule information table from the cache, which reduces the pressure on the database and improves the speed of reading the business rule information table.
[0018] In a preferred embodiment, this application can be further configured such that obtaining the full set of order information includes: Obtain all order information, including: order information that has not been matched after creation, order information whose order status has changed, and order information in all processes after rule information has been changed.
[0019] By adopting the above technical solution, the full set of order information includes: order information that has not been matched after creation, order information whose order status has changed, and all order information in the process of circulation after rule information changes. This makes the obtained full set of order information more complete and comprehensive, and to a certain extent ensures that the rule engine can accurately match order information for each business system.
[0020] In a preferred embodiment, this application can be further configured as follows: after integrating the data of each hit order information corresponding to the rule information, the order information corresponding to each hit order information, and the rule information for each rule information to obtain integrated data, it further includes: Save all the integrated data to a local database; Every second preset time interval, update all integrated data in the local database.
[0021] By adopting the above technical solution, the integrated data is saved to the local database, and all integrated data in the local database is updated every second preset time, which can effectively avoid the loss of integrated data when the integrated data transmission fails.
[0022] Secondly, this application provides an order matching device based on a rules engine, which adopts the following technical solution: An order matching device based on a rules engine includes: The rule information acquisition module is used to acquire multiple rule information corresponding to the business system. The rule information includes at least: rule segment code information and administrative division of the recipient address. The order information acquisition module is used to acquire all order information, where each order information includes: order segment code information and address information; The order information determination module is used to determine, for each rule information, several matching order information corresponding to the rule information from the full amount of order information, and determine the order information corresponding to each matching order information; The data integration module is used to integrate the data of each hit order information, the order information corresponding to each hit order information, and the rule information for each rule information to obtain integrated data, and send all integrated data to the business system.
[0023] By adopting the above technical solution, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it identifies several matching order information from the full set of order information and determines the order information corresponding to each matching order information. Then, it integrates the data of each matching order information, the order information corresponding to each matching order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that meets the corresponding rules for business systems corresponding to different business scenarios, and then integrate the order information that meets the rules and send it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0024] Thirdly, this application provides a rules engine, which adopts the following technical solution: At least one processor; Memory; At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application being configured to: perform the method described above.
[0025] By adopting the above technical solution, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it identifies several matching order information from the full set of order information and determines the order information corresponding to each matching order information. Then, it integrates the data of each matching order information, the order information corresponding to each matching order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that meets the corresponding rules for business systems corresponding to different business scenarios, and then integrate the order information that meets the rules and send it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0026] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described above.
[0027] By adopting the above technical solution, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it identifies several matching order information from the full set of order information and determines the order information corresponding to each matching order information. Then, it integrates the data of each matching order information, the order information corresponding to each matching order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that meets the corresponding rules for business systems corresponding to different business scenarios, and then integrate the order information that meets the rules and send it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0028] In summary, this application includes at least one of the following beneficial technical effects: 1. The rule engine acquires multiple rule information corresponding to the business systems. For each rule information, it identifies several matching order information from the full set of order information and determines the order information corresponding to each matching order information. Then, it integrates the data of each matching order information, the corresponding order information, and the rule information, and sends all the integrated data to the business systems. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that meets the corresponding rules for business systems in different business scenarios, and then integrates the matching order information and sends it to the corresponding business systems to meet the requirements of various complex business scenarios in logistics and transportation. Attached Figure Description
[0029] Figure 1 This is a schematic diagram illustrating the connection relationship between the rule engine and the business system in one embodiment of this application.
[0030] Figure 2 This is a flowchart illustrating an order matching method based on a rule engine, according to one embodiment of this application.
[0031] Figure 3 This is a flowchart illustrating a matching operation based on rule information and the full set of order information, according to one embodiment of this application.
[0032] Figure 4 This is a flowchart illustrating the process of determining several matching order information from the full set of order information, according to one embodiment of this application.
[0033] Figure 5 This is a flowchart illustrating a method for generating basic business information according to one embodiment of this application.
[0034] Figure 6 This is a schematic diagram of the structure of an order matching device based on a rule engine, according to one embodiment of this application.
[0035] Figure 7 This is a schematic diagram of the structure of a rule engine according to one embodiment of this application. Detailed Implementation
[0036] The following combination Figures 1 to 7 This application will be described in further detail.
[0037] This specific embodiment is merely an explanation of this application and is not intended to limit it. After reading this specification, those skilled in the art can make modifications to this embodiment without contributing any inventive step, but such modifications are protected by patent law as long as they are within the scope of this application.
[0038] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0039] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0040] The embodiments of this application will now be described in further detail with reference to the accompanying drawings.
[0041] With the rapid development of the logistics industry, people's lives have become much more convenient. However, various complex business scenarios exist in the actual process of logistics transportation, such as last-mile delivery failures, bank-to-postal transfers, false signatures, lost package tracking, and on-demand delivery. The bank-to-postal transfer scenario involves all express deliveries within a certain area being handled by the postal service. That is, when logistics arrive in this area, the order information needs to be transferred to the postal service for subsequent delivery.
[0042] In actual transportation, the number of orders across the network is huge and the business scenarios of logistics transportation are complex. Each order information and transportation area may have special transportation requirements. If the corresponding order information is not matched based on the business scenario and corresponding measures are not taken in time, logistics abnormalities can easily occur.
[0043] Therefore, this application provides a general order matching method based on a rules engine, which can match order information that conforms to the corresponding rules according to different business scenarios, so as to meet the requirements of various complex business scenarios in logistics and transportation.
[0044] This application provides an order matching method based on a rule engine, which is executed by the rule engine and can connect to various business systems, such as... Figure 1 As shown, Figure 1In the diagram, Business System A, Business System B, Business System C, and Business System D represent various business systems. Each business system sends its relevant information and rule information to the rule engine. The rule engine listens for all order allocation information and matches it with the rule information. If a matching order allocation is found, the engine integrates the matching order allocation information and notifies the corresponding business system, which then performs the corresponding business processing.
[0045] This application provides an order matching method based on a rule engine, such as... Figure 2 As shown, the method includes steps S101, S102, S103, and S104, wherein: Step S101: Obtain multiple rule information corresponding to the business system, wherein the rule information includes at least: rule segment code information and administrative division of the recipient address; In this embodiment of the application, the rule engine pre-stores all rule information pushed by each business system. All rule information pushed by each business system is denoted as a business rule information set, where there is a one-to-one correspondence between the business rule information set and the business system. Therefore, the rule engine can obtain multiple rule information corresponding to each business system based on the business rule information set.
[0046] The method for obtaining the business rule information set is as follows: the rule engine connects with each business system and obtains several rule information from each business system. All rule information pushed by each business system is denoted as the business rule information set. In practical applications, the rule engine connects with multiple business systems, and each business system also pushes at least one rule information to the rule engine. In this embodiment, the business systems include, but are not limited to, systems with unreachable last-mile delivery and systems for transferring mail from public to private accounts. This embodiment does not limit the type of business system. The rule information includes: rule segment code information and the administrative division of the recipient address. It may also include the delivery outlet. The rule segment code information is a three-segment code, where the first segment code represents the province / city, the second segment code represents the outlet, and the third segment code represents the delivery person. That is, the rule information provides limitations in both the outlet dimension (corresponding to the delivery outlet and rule segment code information in the rule information) and the address dimension (corresponding to the administrative division of the recipient address in the rule information).
[0047] For example, if an outbreak occurs in Chang'an District of Shijiazhuang City, Hebei Province, the "Unreachable Terminal" system will push the corresponding delivery outlets, rule segment codes, and administrative divisions of the recipient addresses in Chang'an District to the rule engine, indicating that express delivery in this area is temporarily unavailable.
[0048] Step S102: Obtain all the order information, wherein each order information includes: order segment code information and address information; In this embodiment of the application, after a user places an order on a shopping platform or a logistics website, they will receive order information, which includes, but is not limited to, the recipient's name, recipient's address, and recipient's contact information. The order splitting system will perform order splitting operations based on the recipient's address in the order information, that is, splitting the order into three segments and a cleaned address, which correspond to the order segment code information and address information in the order splitting information, respectively. The cleaned address is obtained by checking for duplicates, completing, and standardizing the recipient address.
[0049] The rules engine obtains all order information, which includes, but is not limited to: order information that has not been matched after creation, order information whose order status has changed, and order information in all processes after rule information has been changed.
[0050] Step S103: For each rule information, determine several matching order information corresponding to the rule information from the full set of order information, and determine the order information corresponding to each matching order information; In this embodiment of the application, for each rule information, all order information is matched against the rule information. For example, if the rule information is a rule pushed by an unreachable end-user system, the rule engine will match all order information against this rule information pushed by the unreachable end-user system. During the matching operation, if any order information matches the rule information successfully, the matching result is recorded as a successful match, and the rule information corresponding to the successful match, the business rule information set to which the rule information belongs, the business system corresponding to the business rule information set, and the rule's effective time are recorded. The number of matched order information may be zero, one, two, or more order information.
[0051] The hit order information refers to the order information that matches the rules. Therefore, the hit order information includes the same information as the original order information, including the order segment code and address information. Furthermore, the order information is obtained by splitting the order from the recipient address in the original order information. Therefore, there is a one-to-one correspondence between the order information and the original order information. Similarly, the hit order information also has a one-to-one correspondence with the original order information. Therefore, for each hit order information, the corresponding order information is determined. The order information includes, but is not limited to: recipient name, recipient address, and recipient contact information.
[0052] For each rule in the business rule information set, the operation of matching the order information with the rule information is performed iteratively, and the order information corresponding to each matched order information is determined, so that all the order information has been matched with all the rule information corresponding to the business system.
[0053] Step S104: For each rule information, integrate the data of each hit order information, the order information corresponding to each hit order information, and the rule information to obtain integrated data, and send all integrated data to the business system.
[0054] In this embodiment of the application, each rule information corresponds to several hit order information. For each hit order information, the data of each hit order information corresponding to the rule information, the order information corresponding to each hit order information, and the rule information are integrated to obtain integrated data. The integrated data is in the form of a data set, and each integrated data corresponds to one hit order information. The data integration is iteratively performed on the several hit order information corresponding to the rule information to obtain all integrated data corresponding to the rule information, and the integrated data is sent to the business system.
[0055] Because rule information and business systems have a one-to-one correspondence, the business system to which integrated data needs to be sent can be uniquely determined based on the rule information. Of course, in the successful matching results, the successfully matched rule information, the business rule information set to which the rule information belongs, the business system corresponding to the business rule information set, and the rule's effective time are also recorded. Therefore, after determining the rule information, the business system to which integrated data needs to be sent can be uniquely determined. If multiple business systems push the same rule information, and some order information matches this same rule information, the rule engine will push the integrated data corresponding to that order information to multiple business systems. Here, the same rule information refers to the rule segment code information and the administrative division of the recipient address being the same, but pushed by different business systems. Specifically, because each rule information has a one-to-one correspondence with a business system when matching all order information with rule information, even if the same rule information exists, this same rule information will also exist in the business rule information sets corresponding to multiple business systems simultaneously. After performing the above matching operation, the integrated data corresponding to that order information can ultimately be pushed to multiple business systems.
[0056] The above embodiments are described in terms of a single business system. However, in practice, rule engines are typically connected to multiple business systems to match integrated data that conforms to corresponding rules for each system. The execution operations for each business system are the same as those described in the above embodiments; therefore, the execution process for multiple business systems is briefly described here. When the rule engine matches integrated data that conforms to corresponding rules for multiple business systems, it obtains the business rule information set corresponding to each business system, matches the full set of order information with each business rule information set, and, based on the matching results, determines several matching order information sets corresponding to each business rule information set from the full set of order information. Then, it sends the integrated data corresponding to the several matching order information sets to the business systems corresponding to the business rule information sets.
[0057] Specifically, for example, the business rule information set includes a first rule information set pushed by the unreachable end-user system and a second rule information set pushed by the public-to-postal system. The first rule information set includes rule information A, rule information B, rule information C, and rule information D; the second rule information set includes rule information a, rule information b, rule information c, and rule information d. The rule engine will match the acquired full set of order information with each rule in both the first and second rule information sets. After matching all the order information with each rule in the first rule information set, it is determined that order information 001 successfully matches rule information A in the first rule information set, and order information 002 and 003 successfully match rule information C in the first rule information set. After matching all the order information with each rule in the second rule information set, it is determined that order information 010 successfully matches rule information b in the second rule information set, and order information 020 and 030 successfully match rule information d in the second rule information set. Therefore, it can be determined that the corresponding hit order information for the first rule information set is order information 001, order information 002, and order information 003; and the corresponding hit order information for the second rule information set is order information 010, order information 020, and order information 030. Then, the integrated data corresponding to the hit order information is sent to the corresponding business system.
[0058] This application describes the process of matching rule information with the full set of order information, such as... Figure 3 As shown, Figure 3 The middle order information represents the order information that has not been matched after creation; the order change information represents the order information whose order status has changed; and the offline task data supplementation information represents the order information in all processes after the rule information has been changed. Figure 3In this context, MQ indicates that order information and order changes are obtained through message queues, and the integrated data is sent to the business system through message queues. Figure 3 The database indicates that data will be integrated and stored in the database.
[0059] As can be seen, in this embodiment, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it determines several matching order information from the full set of order information and the order information corresponding to each matching order information. Then, it integrates the matching order information, the order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that conforms to the corresponding rules for business systems in different business scenarios, and then integrates the matching order information and sends it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0060] Furthermore, to avoid failure to send integrated data to the business system due to incorrect notification method, this embodiment of the application further includes the following step before sending all integrated data to the business system: Based on the basic business information, determine the notification type corresponding to the business system. The basic business information includes at least the notification types corresponding to each of the multiple business systems. Accordingly, all integrated data is sent to the business system, including: By utilizing the notification type corresponding to the business system, all integrated data is sent to the business system.
[0061] In this embodiment, the business basic information table is composed of relevant information sent by various business systems connected to the rule engine. This information includes, but is not limited to, business type, business name, notification type, and callback address. Therefore, the notification type corresponding to a business system can be determined based on the business basic information table. The notification types include MQ (MessageQueue) and HTTP (Hypertext Transfer Protocol) methods. Then, the integrated data is sent to the relevant business system in the form of a notification, and subsequent business processing is performed by each business system itself.
[0062] As can be seen, in this embodiment, the notification type corresponding to the business system is determined based on the basic business information, and the integrated data is sent to the business system through this notification type. Sending the integrated data based on the notification type corresponding to the business system can avoid failure to send the integrated data to the business system due to incorrect notification method.
[0063] Furthermore, to ensure the accuracy of the matching results, in this embodiment, for each rule information, several matching order information corresponding to the rule information are determined from the full set of order information, such as... Figure 4 As shown, the steps include S1031, S1032, S1033, and S1034, wherein: Step S1031: For each rule information, the segment code information of all the sub-segments of the full set of sub-segments is matched with the rule segment code information of the rule information in sequence. The sub-segment code information and the rule segment code information are determined based on the same address library version. In this embodiment of the application, for each rule information, all the segment codes of the full set of order information are matched sequentially with the rule segment codes of the rule information. Both the segment codes and the rule segment codes are in the form of three-segment codes, where the first segment code represents the province / city, the second segment code represents the branch office, and the third segment code represents the delivery person. Furthermore, the segment codes and the rule segment codes are determined based on the same address database version, which ensures that the segment codes and the rule segment codes are divided according to the same standard, making the matching results more accurate.
[0064] Step S1032: If the segment code matching is successful, then the segment information with the successful segment code matching is determined as the hit segment information; Step S1033: If segment code matching fails, then the address information and the administrative division of the recipient address in the rule information of the segment code matching failure sub-order information are matched. The address information and the administrative division of the recipient address are determined based on the same address database version. If the address matching is successful, then the segment order information with successful address matching is determined as the hit segment order information. Step S1034: After completing the matching operation of all order information and rule information, several hit order information are obtained for each rule information.
[0065] In this embodiment, if the segment code matching is successful, the segment information with the successful segment code matching is determined as the hit segment information; if the segment code matching fails, the address information in the segment information with the failed segment code matching is matched with the administrative division of the recipient address in the rule information. The address information in the segment information is obtained by the segment system from cleaning the recipient address in the order information, and address database information is used during address cleaning; the administrative division of the recipient address in the rule information is based on the address database information, and the administrative division consists of provincial-level administrative regions, prefecture-level administrative regions, county-level administrative regions, and township-level administrative regions, which are regions divided by the state for the convenience of administrative management. Therefore, the address information and the administrative division of the recipient address are determined based on the same address database version, which can effectively avoid two different expressions due to the same address information.
[0066] For example, according to the latest version of the address database information: "The Longhua Township of Nankang District, Ganzhou City, is abolished, and the Longhua Town of Nankang District, Ganzhou City is established," if the administrative division of the recipient address in the rule information is determined according to the latest version of the address database information, it will be "Longhua Town of Nankang District, Ganzhou City"; however, the address information in the order information is determined according to the old version of the address database information, which is "Longhua Township of Nankang District, Ganzhou City." Therefore, the information determined by the different address database versions used in the same area will be different. If a matching operation is performed between the address information in the order information and the administrative division of the recipient address in the rule information, the matching will fail, resulting in inaccurate matching results.
[0067] Iteratively perform the matching operation between each rule information and all sub-order information to obtain several matching sub-order information for each rule information.
[0068] As can be seen, in this embodiment, for each rule information, all segment codes of the full set of order information are sequentially matched with the rule segment codes of the rule information. If the segment code match is successful, the order information with the successful segment code match is determined to be the hit order information. If the segment code match fails, the address information of the order information with the failed segment code match is matched with the administrative division of the receiving address of the rule information. If the address match is successful, the order information with the successful address match is determined to be the hit order information. This process is iterated to obtain several hit order information for each rule information. The matching operation between order information and rule information is performed from both the segment code and address dimensions, and the same address database version is used for segment code division and address division, ensuring the accuracy of the matching results.
[0069] Furthermore, to ensure that all information in the basic business information conforms to preset rules, in this embodiment of the application, the method for generating the basic business information includes: Obtain relevant information from each business system, including: business type, business name, notification type, and callback address; Verify that all relevant information conforms to the preset rules, and register all successfully verified relevant information into the business basic information.
[0070] In this embodiment of the application, the relevant information is information sent by each business system to the rule engine, used to characterize the details of each business system. This relevant information includes, but is not limited to: business type, business name, notification type, and callback address. The notification type includes MQ method and HTTP method; if the notification type is HTTP, the callback address information is the HTTP address information. The process of generating the business basic information table is as follows: Figure 5As shown, the rule engine will determine whether the sent relevant information conforms to the preset rules. If it does not conform, it will return a failure message; if it does conform, it will register the relevant information to the business basic information. The business basic information is stored in the database. The business basic information table can also be written to the cache later, and the business system will be returned a "save successful" message.
[0071] For information sent by the business system, the rule engine verifies each piece of information to ensure it conforms to preset rules. These preset rules are pre-defined and stored within the rule engine. For example, the rules for business type and business name require that all characters be English letters and no other characters are allowed; the rules for notification type require that it must be either MQ or HTTP and no other methods are allowed; the rules for callback address require that it be http: / / IP:port / *** and no other format is allowed. This embodiment of the application does not impose limitations on the preset rules for each piece of information and allows for customization based on actual circumstances. If every piece of information conforms to the preset rules, the verification is successful, and the successfully verified information is registered in the business basic information. If any piece of information does not conform to the preset rules, a registration failure message is sent to the business system.
[0072] As can be seen, in this embodiment of the application, relevant information from each business system is obtained, all relevant information is verified to conform to preset rules, and all successfully verified relevant information is registered to the business basic information. In this way, it is ensured that all information in the business basic information conforms to preset rules.
[0073] Furthermore, to improve the accuracy of order matching based on rule information by the rule engine, in this embodiment of the application, the relevant information also includes: full throughput interface information. The order matching method based on the rule engine also includes: Every first preset time interval, a set of valid rule information is obtained from the business system based on full throughput interface information; The effective rule information set is matched with the corresponding business rule information set of the business system to obtain the rule matching result; The business rule information set is updated based on the rule matching results. The business rule information set can be used to obtain multiple rule information corresponding to the business system.
[0074] For the embodiments of this application, the relevant information also includes full throughput interface information. The rule engine can obtain all valid rule information sets in the business system at once based on the full throughput interface information. In actual operation, there may be situations where the business rule information set stored in the rule engine is inconsistent with the valid rule information set in the business system. In order to ensure the consistency of rule information between the rule engine and the business system, the valid rule information set of the business system will be obtained based on the full throughput interface information, and the business rule information set will be updated based on the valid rule information set, so that the business rule information set includes all valid rule information.
[0075] Specifically, every first preset time interval, a valid rule information set is obtained from the business system based on the full throughput interface information. This valid rule information set is then matched against all corresponding rule information in the business system within the business rule information set to obtain a rule matching result. If a match is successful, it is recorded as a successful match; if a match fails, it is recorded as a missing match. Missing matches fall into two categories: first, rule information existing in the valid rule information set is not in the business rule information set (i.e., rule information in the business system has not been pushed to the rule engine); second, rule information existing in the business rule information set is not in the valid rule information set (i.e., invalid rule information is stored in the rule engine). Because inconsistencies may exist between the rule engine and the business system, the business rule information set is updated based on the rule matching result. In the first case, rule information not pushed to the rule engine is added to the business rule information set; in the second case, invalid rule information is deleted from the rule engine. This ensures consistency between the business rule information set in the rule engine and the valid rule information set in the business system, resulting in higher accuracy when the rule engine performs order matching based on rule information. Of course, the obtained valid rule information set can also be used to replace the corresponding business rule information set of the business system, so as to make the rule information of the rule engine and the business system consistent.
[0076] As can be seen, in this embodiment, every first preset time interval, a valid rule information set is obtained from the business system based on the full throughput interface information, the valid rule information set is matched with the corresponding business rule information set of the business system, and the business rule information set is updated based on the rule matching result. In this way, the rule engine is kept consistent with the rule information in the business system, so as to improve the accuracy of the rule engine in matching orders based on the rule information.
[0077] Furthermore, to reduce database pressure and improve the speed of reading the business rule information table, in this embodiment of the application, before obtaining multiple rule information corresponding to the business system, the following steps are also included: Obtain the business rule information set and write it to the cache; Accordingly, obtain multiple rule information corresponding to the business system, including: Read multiple rule information corresponding to the business system from the cache.
[0078] In this embodiment of the application, after obtaining the business rule information set, the business rule information set is written into the cache so that the rule engine does not need to frequently access the database when matching the order information with the rule information, thus reducing the pressure on the database. Moreover, reading the rule data from the business rule information table in the cache is faster than reading it from the database, so as to ensure that the rule engine can obtain the rule information with high performance.
[0079] As can be seen, in this embodiment of the application, the business rule information set is written into the cache. When the rule engine matches the order information with the rule information, it directly reads the business rule information table from the cache, which reduces the pressure on the database and improves the speed of reading the business rule information table.
[0080] Furthermore, to ensure that the rule engine can accurately match order information for each business system, in this embodiment of the application, all order information is obtained, including: Retrieve all order information, including: order information that has not been matched after creation, order information whose order status has changed, and order information in all processes after rule information has been changed.
[0081] In this embodiment of the application, in order to make the full set of order information more complete and comprehensive, the corresponding order information will be pushed to the rule engine for both order changes and rule information changes, so that the order information can be matched with the rule information. This ensures to a certain extent that the rule engine can accurately match order information for each business system.
[0082] When a user places an order on a shopping platform or a logistics company's official website, they receive order information. This information is then split into multiple orders using a splitting system. The rules engine then retrieves this split order information and matches it against existing rules. Newly created split orders that haven't yet been matched by the rules engine require an initial matching process. After the initial matching, no further matching is performed for a certain period. However, logistics typically takes several days, during which the order status will inevitably change. Similarly, the rules pushed to the rules engine by various business systems may also change during transit. Both changes in order status and rule information affect the rules engine's matching results. Therefore, when an order status changes, the split order information corresponding to the changed order status is resent to the rules engine for matching; similarly, when rule information changes, the split order information for goods still in transit is resent to the rules engine for matching.
[0083] As can be seen, in this embodiment of the application, the full amount of order information includes: order information that has not been matched after creation, order information whose order status has changed, and all order information in the process of circulation after the rule information has been changed. This makes the obtained full amount of order information more complete and comprehensive, which to a certain extent ensures that the rule engine can accurately match order information for each business system.
[0084] Furthermore, to effectively avoid data loss due to failed data transmission, in this embodiment, for each rule information, the data of each hit order information, the order information corresponding to each hit order information, and the rule information are integrated to obtain the integrated data, and the process further includes: Save the integrated data to a local database; Every second preset time interval, update all integrated data in the local database.
[0085] In this embodiment of the application, the integrated data is saved to a local database, and every second preset time, all the integrated data in the local database is updated. Specifically, updating all the integrated data in the local database means that only the integrated data sent to each business system within a certain period of time is saved in the local database, and the integrated data that has been stored for a long time is deleted to avoid storing too much data in the database. For example, only the integrated data sent to each business system in the last two months is saved, and the integrated data sent two months ago is deleted.
[0086] After performing matching operations and data integration, the rules engine sends the integrated data to the target business system and saves the integrated data to the local database. On the one hand, this serves as a backup to effectively prevent the loss of integrated data in case of failure to send the integrated data; on the other hand, it can also be used for data analysis to predict the actual working status of each business system.
[0087] As can be seen, in this embodiment of the application, saving the integrated data to the local database and updating all the integrated data in the local database every second preset time can effectively avoid the loss of integrated data when the integrated data fails to be sent.
[0088] The above embodiments describe an order matching method based on a rule engine from the perspective of process flow. The following embodiments describe an order matching device based on a rule engine from the perspective of virtual modules or virtual units. For details, please refer to the following embodiments.
[0089] This application provides an order matching device 200 based on a rule engine, such as... Figure 6 As shown, the rule engine-based order matching device 200 may specifically include: The rule information acquisition module 210 is used to acquire multiple rule information corresponding to the business system. The rule information includes at least: rule segment code information and administrative division of the recipient address. The order information acquisition module 220 is used to acquire all the order information, wherein each order information includes: order segment code information and address information; The order information determination module 230 is used to determine, for each rule information, several matching order information corresponding to the rule information from the full set of order information, and determine the order information corresponding to each matching order information. The data integration module 240 is used to integrate the data of each hit order information, the order information corresponding to each hit order information, and the rule information for each rule information to obtain integrated data, and then send all integrated data to the business system.
[0090] In this embodiment, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it determines several matching order information from the full set of order information and the corresponding order information. Then, it integrates the matching order information, the corresponding order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that conforms to the corresponding rules for business systems in different business scenarios, and then integrates the matching order information and sends it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0091] One possible implementation of this application embodiment, the order matching device 200 based on a rule engine, further includes: The notification type determination module is used to determine the notification type corresponding to the business system based on the basic business information. The basic business information includes at least the notification types corresponding to each of the multiple business systems. Accordingly, when the data integration module 240 executes the action of sending all integrated data to the business system, it is used for: By utilizing the notification type corresponding to the business system, all integrated data is sent to the business system.
[0092] In one possible implementation of this application embodiment, when the order information determination module 230 performs the operation of determining a number of matching order information corresponding to each rule information from the full set of order information, it is used to: For each rule information, the segment code information of all the sub-order information in the full set of sub-order information is matched with the rule segment code information of the rule information in turn. The sub-order segment code information and the rule segment code information are determined based on the same address library version. If the segment code is successfully matched, the segment information with the successfully matched segment code is determined to be the hit segment information; If segment code matching fails, the address information and the administrative division of the recipient address in the rule information of the segment code matching failure will be matched. The address information and the administrative division of the recipient address are determined based on the same address database version. If the address matching is successful, the segment information with the successful address matching is determined as the hit segment information. After completing the matching operation of all order information and rule information, several hit order information are obtained for each rule information.
[0093] One possible implementation of this application embodiment, the order matching device 200 based on a rule engine, further includes: The business basic information generation module is used to obtain relevant information from various business systems. This information includes: business type, business name, notification type, and callback address. Verify that all relevant information conforms to the preset rules, and register all successfully verified relevant information into the business basic information.
[0094] One possible implementation of this application embodiment includes, among other related information: full throughput interface information. The rule-based order matching device 200 also includes: The update module is used to obtain a set of valid rule information from the business system based on the full throughput interface information every first preset time interval; The effective rule information set is matched with the corresponding business rule information set of the business system to obtain the rule matching result; The business rule information set is updated based on the rule matching results. The business rule information set can be used to obtain multiple rule information corresponding to the business system.
[0095] One possible implementation of this application embodiment, the order matching device 200 based on a rule engine, further includes: The business rule information set caching module is used to obtain the business rule information set and write it into the cache. Accordingly, when the rule information acquisition module 210 acquires multiple rule information corresponding to the business system, it is used for: Read multiple rule information corresponding to the business system from the cache.
[0096] In one possible implementation of this application embodiment, when the order information acquisition module 220 performs the task of acquiring all order information, it is used to: Retrieve all order information, including: order information that has not been matched after creation, order information whose order status has changed, and order information in all processes after rule information has been changed.
[0097] One possible implementation of this application embodiment, the order matching device 200 based on a rule engine, further includes: An integrated data storage module is used to save all integrated data to a local database; Every second preset time interval, update all integrated data in the local database.
[0098] This application provides a rule engine, such as... Figure 7 As shown, Figure 7The rule engine 300 shown includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, for example, via a bus 302. Optionally, the rule engine 300 may also include a transceiver 304. It should be noted that in practical applications, the transceiver 304 is not limited to one, and the structure of this rule engine 300 does not constitute a limitation on the embodiments of this application.
[0099] Processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. Processor 301 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0100] Bus 302 may include a pathway for transmitting information between the aforementioned components. Bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 302 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 7 The symbol is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0101] The memory 303 may be a ROM (Read Only Memory) or other type of static storage device capable of storing static information and instructions, RAM (Random Access Memory) or other type of dynamic storage device capable of storing information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but not limited thereto.
[0102] The memory 303 is used to store application code that executes the solution of this application, and its execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the foregoing method embodiments.
[0103] The rule engine includes, but is not limited to, mobile terminals such as mobile phones, laptops, digital radio receivers, PDAs (Personal Digital Assistants), PADs (Tablet PCs), PMPs (Portable Multimedia Players), and in-vehicle terminals (such as in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. It can also be used for servers, etc. Figure 7 The rule engine shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0104] This application provides a computer-readable storage medium storing a computer program that, when run on a computer, enables the computer to execute the corresponding content in the aforementioned method embodiments. Compared with related technologies, in this application embodiment, the rule engine obtains multiple rule information corresponding to the business system. For each rule information, it determines several matching order information from the full set of order information and the order information corresponding to each matching order information. Then, it integrates the matching order information, the order information, and the rule information, and sends all the integrated data to the business system. The rule engine monitors the order information across the entire network in real time and matches the order information based on multiple rule information pushed by various business systems. It can match order information that conforms to the corresponding rules for business systems in different business scenarios, and integrate the matching order information before sending it to the corresponding business system to meet the requirements of various complex business scenarios in logistics and transportation.
[0105] It should be understood that although the steps in the flowcharts of the accompanying figures are shown sequentially as indicated by the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the accompanying figures may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0106] The above are only some embodiments of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A rule engine based order matching method, characterized in that, include: Obtain multiple rule information corresponding to the business system. The rule information includes at least: rule segment code information and administrative division of the recipient address. Obtain all order information, including: order information that has not been matched after creation, order information whose order status has changed, and all order information in circulation after rule information has been changed. Each order information includes: order segment code information and address information. For each rule information, determine several matching order information corresponding to the rule information from the full set of order information, and determine the order information corresponding to each matching order information; For each rule information, the data of each hit order information, the order information corresponding to each hit order information, and the rule information are integrated to obtain integrated data, and all integrated data are sent to the business system. For each rule information, determining several matching order information corresponding to the rule information from the full set of order information includes: For each rule information, all segment code information of the full set of segment information is sequentially matched with the rule segment code information of the rule information, wherein the segment code information and the rule segment code information are determined based on the same address library version; If the segment code is successfully matched, then the segment information with the successfully matched segment code is determined to be the hit segment information; If segment code matching fails, the address information and the administrative division of the recipient address in the rule information of the segment code matching failure will be matched. The address information and the administrative division of the recipient address are determined based on the same address database version. If the address matching is successful, the segment information with successful address matching is determined as the hit segment information. After completing the matching operation of all order information and rule information, several hit order information are obtained for each rule information.
2. The rule engine based order matching method as claimed in claim 1, wherein, Before sending all integrated data to the business system, the process also includes: Based on the basic business information, determine the notification type corresponding to the business system, wherein the basic business information includes at least the notification types corresponding to each of the multiple business systems; Accordingly, sending all integrated data to the business system includes: Using the notification type corresponding to the business system, all integrated data is sent to the business system.
3. The rule engine based order matching method as claimed in claim 2, wherein, The methods for generating basic business information include: Obtain relevant information from each business system, including: business type, business name, notification type, and callback address; Verify that all relevant information conforms to the preset rules, and register all successfully verified relevant information into the business basic information.
4. The order matching method based on a rule engine according to claim 3, characterized in that, The relevant information also includes: full throughput interface information. The method further includes: Every first preset time interval, a set of valid rule information is obtained from the business system based on the full throughput interface information; The effective rule information set is matched with the business rule information set corresponding to the business system to obtain the rule matching result; The business rule information set is updated based on the rule matching result, wherein multiple rule information corresponding to the business system can be obtained based on the business rule information set.
5. The order matching method based on a rule engine according to claim 4, characterized in that, Before obtaining the multiple rule information corresponding to the business system, the process also includes: Obtain the business rule information set and write the business rule information set into the cache; Accordingly, obtaining multiple rule information corresponding to the business system includes: Read multiple rule information corresponding to the business system from the cache.
6. The order matching method based on a rule engine according to any one of claims 1 to 5, characterized in that, For each rule information, the process of integrating the corresponding hit order information, the corresponding order information, and the rule information to obtain integrated data further includes: Save all the integrated data to a local database; Every second preset time interval, update all integrated data in the local database.
7. An order matching device based on a rule engine, characterized in that, Performing the order matching method based on a rule engine as described in any one of claims 1-6 includes: The rule information acquisition module is used to acquire multiple rule information corresponding to the business system. The rule information includes at least: rule segment code information and administrative division of the recipient address. The order information acquisition module is used to acquire all order information, where each order information includes: order segment code information and address information; The order information determination module is used to determine, for each rule information, several matching order information corresponding to the rule information from the full amount of order information, and determine the order information corresponding to each matching order information; The data integration module is used to integrate the data of each hit order information, the order information corresponding to each hit order information, and the rule information for each rule information to obtain integrated data, and send all integrated data to the business system.
8. A rules engine, characterized in that, include: At least one processor; Memory; At least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, said at least one application being configured to: perform the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Similarity-based address matching method and device
CN113837698A
System for developing literacy skills using loosely coupled tools in a self-directed learning process within a collaborative social network
US20080176194A1