Order synchronization method, device, electronic device and storage medium

Through automatic matching of order feature codes and synchronization rules and dynamic message generation, the complexity and efficiency of the order synchronization system are solved, and efficient and accurate order information synchronization is achieved to meet different business needs.

CN114240564BActive Publication Date: 2025-08-19CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111567535.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-20
Publication Date
2025-08-19
Estimated Expiration
2041-12-20

AI Technical Summary

Technical Problem

The existing order synchronization method is highly complex and difficult to operate and maintain when facing a variety of business scenarios, and cannot improve efficiency and ease of use, and cannot meet the requirements of real-time, accuracy and completeness.

Method used

By generating the order's characteristic code, matching the synchronization rules of the order demander based on the order information, generating synchronization tasks, and determining the synchronization fields required by the demander, dynamically generating synchronization messages. Multi-threaded parallel processing and retry mechanisms are adopted to achieve automatic matching rules and efficient synchronization.

Benefits of technology

It reduces the redundancy of unified protocol rules, improves the efficiency and accuracy of order synchronization, meets the business needs of different order demanders, and reduces the economic losses caused by missing orders.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114240564B_ABST
    Figure CN114240564B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose an order synchronization method, device, electronic device and storage medium, the method including: generating a feature code of an order based on order information corresponding to the order, the order information is used to describe the order details of the order, and the feature code is used to describe the feature information of the order; matching the feature code of the order with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order; the synchronization task includes synchronization rules that match the order; determining the synchronization fields required by the order demander contained in the order information, and generating a synchronization message containing the synchronization fields; sending the synchronization message corresponding to the synchronization task to the order demander according to the synchronization task; jumping out of the different structures of various order information themselves, realizing automatic matching rules and generating synchronization tasks, which can better meet the business needs of different order demanders, reduce the redundancy caused by unified protocol rules, and improve synchronization efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a data synchronization technology, and provides an order synchronization method, device, electronic device and computer-readable storage medium. Background Art

[0002] With the booming development of online business, the types and quantities of orders received by the system are increasing. In order to achieve business functions such as precision marketing and real-time commission settlement, the various order demanders have an increasingly high demand for order information synchronization; and real-time, accuracy and completeness have become requirements that the order synchronization system must meet.

[0003] The order synchronization method in related technologies customizes the business screening process and synchronization protocol according to different business scenarios. With the continuous iteration of business rules, the system becomes more and more complex, and the difficulty of operation and maintenance gradually increases, which cannot truly improve the efficiency and ease of use of the order synchronization system. Summary of the Invention

[0004] The purpose of this application is to provide an order synchronization method, an order synchronization device, an electronic device and a computer-readable storage medium, which can break away from the different structures of various order information themselves, realize automatic matching rules and generate synchronization tasks, better meet the business needs of different order demanders, reduce the redundancy caused by unified protocol rules, and improve synchronization efficiency.

[0005] The present application proposes an order synchronization method, including: generating a feature code of the order based on order information corresponding to the order, the order information is used to describe the order details of the order, and the feature code is used to describe the feature information of the order; matching the feature code of the order with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order; the synchronization task includes synchronization rules that match the order; determining the synchronization fields required by the order demander contained in the order information, and generating a synchronization message containing the synchronization fields; and sending the synchronization message corresponding to the synchronization task to the order demander according to the synchronization task.

[0006] Furthermore, before generating the characteristic code of the order based on the order information corresponding to the order, the method also includes: establishing multiple message queues based on multiple business channels; the business channels are used to generate and transmit the order information; and obtaining the order information corresponding to the order from multiple business channels in real time through the message queues.

[0007] Furthermore, the characteristic information includes at least one of queue name, store code, store type, sales product type, order type, order source, province code, payment type, channel code, drainage information, city code and sales product code.

[0008] Furthermore, before matching the feature code of the order with multiple synchronization rules corresponding to the order demander to generate the synchronization task of the order, the method also includes: obtaining the screening configuration of the order demander, the screening configuration is used to describe the target characteristic information of the order that the order demander needs to synchronize; comparing the target characteristic information with the characteristic information described by the feature code of the order to determine whether the order corresponding to the feature code is the order to be synchronized.

[0009] Furthermore, the synchronization rules are described in the form of regular expressions; matching the feature code of the order with multiple synchronization rules corresponding to the order demander to generate the synchronization task of the order includes: traversing each regular expression, looking for a regular expression that matches the feature code of the order to be synchronized, and using the matched regular expression as the target regular expression of the order to be synchronized; generating the synchronization task of the order to be synchronized according to the synchronization rule corresponding to the target regular expression.

[0010] Furthermore, determining the synchronization fields required by the order demander contained in the order information includes: obtaining subscription parameters from the order demander, and the subscription parameters are used to describe the field information subscribed by the order demander; filtering out the fields subscribed by the order demander from all information fields contained in the order information corresponding to the order to be synchronized, and using the filtered fields as synchronization fields.

[0011] Furthermore, when the synchronization task includes multiple tasks, sending the synchronization message to the order demander according to the synchronization task includes: creating multiple threads, the multiple threads are used to execute multiple synchronization tasks in parallel, and sending the synchronization field to the order demander according to the receiving address of the order demander contained in the synchronization message; when the synchronization message fails to be sent, re-executing the synchronization task corresponding to the synchronization message that failed to be sent.

[0012] The present application also proposes an order synchronization device, including: an order acquisition module, used to generate a feature code of the order based on the order information corresponding to the acquired order, the order information is used to describe the order details of the order, and the feature code is used to describe the feature information of the order; a rule matching module, used to match the feature code of the order with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order; the synchronization task includes synchronization rules that match the order; a message generation module, used to determine the synchronization field required by the order demander contained in the order information, and generate a synchronization message containing the synchronization field; a message sending module, used to send the synchronization message corresponding to the synchronization task to the order demander according to the synchronization task.

[0013] The present application also proposes an electronic device, which includes: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method described above.

[0014] The present application also proposes a computer-readable storage medium on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method described above.

[0015] Compared with the prior art, this application has the following beneficial effects:

[0016] In the technical solution provided by this application, the different structures of various order information themselves are broken out, and a feature code describing the characteristic information of the order is generated through the order information. Then, through multiple synchronization rules corresponding to the order demander, automatic matching rules are realized and synchronization tasks are generated. The synchronization fields required by the order demander are selected to generate synchronization messages, which can better meet the business needs of different order demanders, reduce the redundancy caused by unified protocol rules, and improve synchronization efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a schematic diagram of an implementation environment involved in this application;

[0018] Figure 2 This is a flowchart of an order synchronization method shown in an exemplary embodiment of the present application;

[0019] Figure 3 yes Figure 2 A schematic diagram of the process before step S120 in the illustrated embodiment;

[0020] Figure 4 yes Figure 2 A schematic flow chart of step S120 in the illustrated embodiment;

[0021] Figure 5 yes Figure 2 A schematic diagram of a flow chart of determining a synchronization field in step S130 in the illustrated embodiment;

[0022] Figure 6 yes Figure 2 A flow chart showing the step S140 in the embodiment shown, in which a synchronization message is sent to the order requester;

[0023] Figure 7 is a flowchart of another order synchronization method shown in an exemplary embodiment of the present application;

[0024] Figure 8This is a structural diagram of an order synchronization device shown in an exemplary embodiment of the present application;

[0025] Figure 9 A schematic structural diagram of an electronic device suitable for implementing the embodiments of the present application is shown. DETAILED DESCRIPTION

[0026] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different figures represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.

[0027] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0028] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0029] It should also be noted that the term "plurality" used in this application refers to two or more. "And / or" describes the relationship between associated objects, indicating that three possible relationships exist. For example, "A and / or B" can mean: A exists alone, A and B exist simultaneously, or B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0030] See also Figure 1 , Figure 1 Schematic diagram of an implementation environment involved in this application. The implementation environment includes an order provider 10, an order synchronization device 20, and an order requester 30. The order provider 10, the order synchronization device 20, and the order requester 30 communicate with each other via a wired or wireless network.

[0031] The order provider 10 is used to provide orders;

[0032] The order synchronization device 20 is used to generate a feature code of the order based on the order information corresponding to the order, where the order information is used to describe the order details of the order, and the feature code is used to describe the feature information of the order; match the feature code with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order; the synchronization task includes the synchronization rules that match the order; determine the synchronization fields required by the order demander contained in the order information to generate a synchronization message containing the synchronization fields; and send the synchronization message corresponding to the synchronization task to the order demander according to the synchronization task;

[0033] The order demander 30 is used to receive the synchronization message and implement business functions such as precision marketing and real-time commission settlement based on the synchronization fields in the synchronization message.

[0034] Among them, the order provider 10 and the order synchronization device 20 can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers. They can also be cloud servers that provide basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network) and big data and artificial intelligence platforms. There is no restriction on this here.

[0035] The order requester 30 may be the physical server described above or a terminal. The terminal may be implemented in various forms. For example, the terminal described in the present invention may include mobile terminals such as mobile phones, tablet computers, laptop computers, PDAs, PDAs, PMPs, wearable devices, smart bracelets, and fixed terminals with dial-up capabilities such as digital TVs and desktop computers.

[0036] See also Figure 2 , Figure 2 This is a flowchart of an order synchronization method shown in an exemplary embodiment of the present application. The order synchronization method is composed of Figure 1 The order synchronization device shown in FIG. 1 is executed, and the order synchronization method includes steps S110 to S140, which are described in detail as follows:

[0037] S110. Generate a feature code for the order based on the order information corresponding to the order. The order information is used to describe order details, and the feature code is used to describe feature information of the order.

[0038] It is understandable that the order synchronization device will first obtain multiple orders, each order corresponds to an order information, and the order information is used to describe the order details of the order, such as the order number, order time, sales product information, store information, etc.

[0039] In this embodiment, the method of obtaining orders and order information can be flexibly adjusted according to actual needs, such as real-time acquisition, that is, each time an order is generated, the order and the order information of the order are obtained from the order provider; the method of obtaining orders and order information can also be obtained according to preset intervals, for example, obtaining from the order provider every 3 seconds.

[0040] Optionally, in order to avoid missing orders, the order providers in this embodiment include but are not limited to various order production platforms and agents; the order production platform can be an e-commerce platform such as Taobao store, JD.com, or a physical store such as a telecommunications business hall, or a self-built platform such as an APP mall, WeChat mini-program mall, etc.; an agent refers to a seller who is entrusted to sell the products.

[0041] Furthermore, the order synchronization device obtains order information from multiple business channels in real time via message queues. Business channels are used to generate and transmit order information. Business channels can be understood as distribution channels, which are the circulation routes of goods. They refer to the way in which the manufacturer's goods are sold to different regions through a certain social network, agents, or distributors to achieve sales goals. Therefore, channels are also called networks. Depending on the order provider, business channels can also be divided into e-commerce channels, physical channels, self-built channels, and third-party agency channels.

[0042] Since there are multiple business channels, in this embodiment, multiple message queues can be established based on multiple business channels, such as a message queue for an e-commerce channel, a message queue for a physical channel, a message queue for a self-built channel, and a message queue for a third-party agent channel; the order synchronization device can receive each order information from the message queue in sequence according to the time sequence of the orders.

[0043] In this embodiment, in order to distinguish between message queues and service channels, it is necessary to set the name of each message queue and the code of the service channel to uniquely identify which message queue and which channel.

[0044] It should be noted that after obtaining the order information for each order, a characteristic code is generated based on the order information. This characteristic code is used to describe the characteristic information of the order. This characteristic information refers to representative information that uniquely represents the characteristics of the order. Specifically, specific representative information is extracted from the order information as characteristic information, and the characteristic information of the order is represented by numbers and / or characters to form the characteristic code of the order. Each order information corresponds to a characteristic code.

[0045] Optionally, the characteristic information includes at least one of queue name, store code, store type, sales product type, order type, order source, province code, payment type, channel code, drainage information, city code and sales product code; the queue name refers to the name of the message queue, and the drainage message refers to the information set to promote sales products and attract traffic, such as advertising information, promotional information, etc.

[0046] For example, the feature codes of an order generated based on the above 11 feature information are "QNO, shopId, abType, xspType, orderType, orderSource, prov, payType, channleId, cps, city, xspId" in sequence.

[0047] In this embodiment, the different structures of various order information are removed, and characteristic information of the order is extracted from the order information. Eleven highly representative characteristic information are analyzed to characterize each order, and these 11 characteristic information can fully cover the important information in the order information.

[0048] S120: Match the feature code of the order with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order; the synchronization task includes the synchronization rules for the order.

[0049] It should be noted that for the order demander, not every order may require synchronization. Therefore, in this embodiment, before matching the feature code with the multiple synchronization rules corresponding to the order demander, it is necessary to determine whether the order needs to be synchronized.

[0050] Optional, such as Figure 3 As shown, Figure 3 for Figure 2 The flowchart before step S120 in the illustrated embodiment includes:

[0051] S310: Acquire a screening configuration of the order requester, where the screening configuration is used to describe target characteristic information of the order that the order requester needs to synchronize;

[0052] In this embodiment, the order demander can set the filtering configuration according to actual needs, that is, set which orders need to be synchronized through the characteristic information of the order; therefore, after the order synchronization device generates a characteristic code based on the order information of the order, the characteristic information described by the characteristic code is used as the basis for judging whether the order is synchronized.

[0053] In this embodiment, the order demander may set the screening configuration and then send the screening configuration to the order synchronization device.

[0054] S320: Match the target feature information with the feature information described by the feature code of the order to determine whether the order corresponding to the feature code is the order to be synchronized.

[0055] Specifically, the target feature information is compared with the feature information described by the feature code to screen multiple orders and determine the orders to be synchronized. For example, if the target feature information is the order type of WeChat Pay, then as long as the feature information described by the feature code of the order contains WeChat Pay, the order will be considered as an order to be synchronized, and then it can be determined whether each order is an order that needs to be synchronized. Of course, the screening configuration set by the order demander can be flexibly adjusted and is limited here.

[0056] It is understandable that there can be multiple order demanders, and different order demanders have different corresponding filtering configurations. Therefore, in this embodiment, it is necessary to match the feature information described by the feature code of each order with all the filtering configurations in turn, and then determine whether each order is an order that needs to be synchronized for each order demander; for example, for order a, it may be the order required by order demander 1, but not the order required by order demander 2.

[0057] In this embodiment, the feature information described by the feature code is used as a basis for determining whether an order is synchronized, thereby ensuring the accuracy and reliability of order synchronization.

[0058] In another embodiment, the order synchronization device may also synchronize all orders as orders to be synchronized to each order demander, and each order demander may then filter the synchronized orders.

[0059] In this embodiment, after the orders to be synchronized are determined, each order requester is assigned multiple synchronization rules, wherein the synchronization rules can be configured by the order requester; the synchronization rules are used to describe which orders to synchronize and in what manner. For example, for WeChat Pay orders, the order is synchronized immediately when the order payment is successful.

[0060] As mentioned above, the feature code is composed of numbers or characters. In order to better match the feature code with the synchronization rule, the synchronization rule in this embodiment is described in the form of a regular expression. The regular expression (Regular Expression) is a logical formula for string operations. It is a logical formula for string operations (including ordinary characters (for example, letters between a to z) and special characters (called "meta-characters")). That is, some pre-defined specific characters and combinations of these specific characters are used to form a "regular string". This "regular string" is used to express a filtering logic for the string.

[0061] Optional, such as Figure 4 As shown, Figure 4 yes Figure 2 The flowchart of step S120 in the illustrated embodiment includes:

[0062] S121. Traverse each regular expression to find a regular expression that matches the feature code of the order to be synchronized, and use the matching regular expression as the target regular expression of the order to be synchronized.

[0063] It is understandable that since regular expressions describe synchronization rules in the form of characters, multiple synchronization rules may be set for an order demander. In order to avoid missed matches, each regular expression is traversed, and the characters of each regular expression are matched with the characters of the feature code to find the regular expression that matches the feature code; for example, for order demander a, the feature code is xspId:00000000C30FB956BE; shopId:201, indicating the type of product sold and the store code; regular expression 1 is ^00000000C30FB956BE\b201$; regular expression 2 is ^00000000C30FB9591BE\b301$, then the feature code is matched with these two regular expressions, and the target regular expression of the feature code is determined to be 1.

[0064] In one example, the number of matched target regular expressions may be one or more.

[0065] S122. Generate a synchronization task for the order to be synchronized according to the synchronization rule corresponding to the target regular expression.

[0066] When the target regular expression is determined, it means determining how to synchronize the order to the order demander. For a more orderly synchronization, in this embodiment, after the target regular expression is determined, a synchronization task is created. The synchronization task includes synchronization rules for triggering the synchronization operation of the order, that is, when the synchronization task is executed, the order is synchronized to the order demander based on the synchronization rules.

[0067] In this embodiment, by configuring the feature code with synchronization rules that support regular expressions, automatic matching rules are implemented, reducing the cost of multiple calls to each order system to obtain order details, performing synchronization operations in a timely and accurate manner, and reducing the economic losses caused by missed orders.

[0068] S130: Determine the synchronization field required by the target device of the order requester contained in the order information to generate a synchronization message containing the synchronization field.

[0069] It is understandable that the order information of an order includes multiple order fields, such as order time field, order number field, payer field, etc.; rather than all fields of the order information are what the order demander wants, it is necessary to filter the various information of the order information, select the fields required by the order demander, and use the required fields as synchronization fields, and then generate a synchronization message containing the synchronization fields. On the one hand, it meets the needs of the order demander, and on the other hand, it also reduces the resources occupied by information transmission.

[0070] In this embodiment, if Figure 5 As shown, Figure 5 yes Figure 2 The flowchart of step S130 of determining the synchronization field in the illustrated embodiment specifically includes:

[0071] S131. Obtain subscription parameters from the order requester, where the subscription parameters are used to describe the field information subscribed by the order requester.

[0072] In this embodiment, the order synchronization device may divide the order information into multiple information fields and send the multiple information fields to the order demander. The order demander subscribes to which information fields are required by the order demander. Then, the order synchronization device can obtain subscription parameters from the order demander, for example, subscription parameters include order code, order type, and sales product code.

[0073] S132: Filter out the fields subscribed by the order demander from all information fields included in the order information of the order to be synchronized, and use the filtered fields as synchronization fields.

[0074] After knowing the subscription parameters of the order demander, the fields subscribed by the order demander can be filtered out from all the information fields contained in the order information of the order to be synchronized. For example, the order code, order type and sales product code of a certain order to be synchronized can be filtered out, and these three fields can be used as synchronization fields.

[0075] It is understandable that there can be multiple order demanders, and different order demanders correspond to different subscription parameters. Therefore, the filtered synchronization fields include multiple groups, and one group of synchronization fields corresponds to one order demander.

[0076] In this embodiment, after determining the field to be synchronized, a synchronization message containing the synchronization field is further generated, wherein the synchronization message also includes the receiving address of the order demander. It can be understood that there may be multiple order demanders, and different order demanders have different corresponding receiving addresses. Therefore, different synchronization messages are generated through the synchronization field and the interface address of the order demander.

[0077] In this embodiment, the synchronization message corresponds to the synchronization task. For example, the synchronization task is produced based on a certain order b, and the synchronization message is also generated based on the order b. Since the receiving addresses of the order demanders are different, the same synchronization task may correspond to multiple synchronization messages. For example, the synchronization rules set by order demanders 1 and order demanders 2 are the same, and then the same synchronization task based on order b will be generated for order demanders 1 and order demanders 2. However, since the receiving addresses of the order demanders are different, when generating the synchronization message, synchronization message 1 and synchronization message 2 are generated.

[0078] In this embodiment, the use of synchronization messages that support dynamic combination of synchronization fields can better meet the business needs of different partners, reduce redundancy caused by unified protocol rules, reduce system resource consumption, and improve synchronization efficiency.

[0079] S140. Send a synchronization message corresponding to the synchronization task to the order requester according to the synchronization task.

[0080] In this embodiment, since the synchronization task includes when and how to perform synchronization, the synchronization message can be sent to each order demander as required according to the synchronization task.

[0081] It is understandable that a synchronization task may correspond to one synchronization message or multiple synchronization messages. In this embodiment, there may be multiple synchronization tasks. Therefore, when the synchronization task includes multiple synchronization tasks, in order to improve synchronization efficiency, such as Figure 6 As shown, Figure 6 yes Figure 2 The flowchart of step S140 in the embodiment shown in the figure is to send the synchronization message to the order requester, including:

[0082] S141. Create multiple threads, which are used to execute multiple synchronization tasks in parallel, and send the synchronization field to the order requester according to the order requester address contained in the synchronization message;

[0083] In this embodiment, multiple threads are created, and each thread can synchronously process synchronization tasks in parallel. For example, thread 1 executes synchronization task 1. The synchronization rule included in the synchronization task is to send the synchronization field of the order to order demander 1 in the early morning of each day. Then, thread 1 will send the synchronization field to the order demander based on the receiving address of order demander 1 in synchronization message 1 in the early morning; and at the same time, thread 2 is also executing another synchronization task.

[0084] S142: When the synchronization message fails to be sent, re-execute the synchronization task corresponding to the synchronization message that fails to be sent.

[0085] It is understandable that there may be a problem during the field sending process, such as the link with the order demander is disconnected, then the synchronization message will fail to be sent, and the synchronization task corresponding to the synchronization message that failed to be sent will be re-executed at this time; for example, after thread 1 fails to send synchronization message 1, the synchronization task corresponding to the synchronization message 1 will be re-executed first, that is, the synchronization operation will be re-triggered.

[0086] To facilitate understanding, this embodiment illustrates the order synchronization method using a more specific application scenario. This order synchronization method receives order information from various production platforms in real time on the operator's online system side, generates a self-describing feature code based on the actual attributes of the order, matches it with the partner's synchronization configuration, and uses flexible synchronization messages to achieve real-time and accurate synchronization of order information.

[0087] Specifically, such as Figure 7 As shown, the order demander is a partner, and the order synchronization method includes:

[0088] S710: Receive an order.

[0089] Obtain real-time order information, order status changes, and other information from various order production platforms, agent platforms, and provincial platforms.

[0090] S720: Generate a feature code based on the order information.

[0091] In this embodiment, various actual information related to the order can be obtained through the order details interface, and a self-describing feature code can be generated. The feature code is used to describe the feature information of the order, which includes queue name, store code, store type, sales product type, order type, order source, province code, payment type, channel code, drainage information, city code and sales product code.

[0092] S730: Obtain the synchronization rules of the partner.

[0093] S740: Match the feature code with the synchronization rule to generate a synchronization task for the order.

[0094] The order synchronization task is generated by matching the 11 feature information of the feature code with multiple synchronization rules that support single-dimensional regular expressions.

[0095] S750: Determine the fields required by the partner from the order information and dynamically generate a synchronization message.

[0096] By subscribing to the parameters, the partners can select the fields they need from the full set of 55 order information fields and dynamically generate synchronization messages. The subscription parameters include the fields required by the partners.

[0097] S760: Execute synchronization tasks in parallel using multiple threads to send synchronization messages to partners.

[0098] When multiple threads execute synchronization tasks in parallel, different synchronization messages can be sent to different partners through multiple threads.

[0099] The order synchronization method provided in this embodiment first transcends the varying structures of various order information, extracts order feature information, and analyzes 11 representative features as the basis for determining order synchronization. By configuring synchronization rules that support regular expressions, automatic rule matching is implemented, reducing the economic losses caused by missed orders. Second, the use of synchronization messages that support dynamic combination of synchronization fields better meets the business needs of different partners, reduces redundancy caused by unified protocol rules, reduces system resource consumption, and improves synchronization efficiency.

[0100] The following describes an embodiment of the device of the present application, which can be used to execute the order synchronization method in the above embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the order synchronization method in the above embodiment of the present application.

[0101] like Figure 8 As shown, Figure 8 : is a structural diagram of an order synchronization device shown in an exemplary embodiment of the present application, comprising:

[0102] An order acquisition module 810 is configured to generate a feature code for an order based on order information corresponding to the order, where the order information is used to describe order details and the feature code is used to describe feature information of the order;

[0103] The rule matching module 820 is used to match the feature code of the order with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order; the synchronization task includes the synchronization rules that match the order;

[0104] The message generation module 830 is used to determine the synchronization fields required by the order demander contained in the order information and generate a synchronization message containing the synchronization fields;

[0105] The message sending module 840 is used to send the synchronization message corresponding to the synchronization task to the order demander according to the synchronization task.

[0106] In some embodiments of the present application, based on the aforementioned solution, the order synchronization device further includes a creation module and a retrieval module. The creation module is specifically configured to establish multiple message queues based on multiple business channels; the business channels are configured to generate and transmit order information. In this case, the retrieval module is specifically configured to retrieve order information corresponding to orders from the multiple business channels in real time via the message queues.

[0107] In some embodiments of the present application, based on the aforementioned scheme, the characteristic information includes at least one of queue name, store code, store type, sales product type, order type, order source, province code, payment type, channel code, drainage information, city code and sales product code.

[0108] In some embodiments of the present application, based on the aforementioned scheme, the data synchronization device also includes a screening module. Before the rule matching module matches the feature code of the order with multiple synchronization rules corresponding to the order demander to generate a synchronization task for the order, the screening module is specifically used to obtain the screening configuration of the order demander, and the screening configuration is used to describe the target characteristic information of the order that the order demander needs to synchronize; the target characteristic information is compared with the characteristic information described by the feature code of the order to determine whether the order corresponding to the feature code is the order to be synchronized.

[0109] In some embodiments of the present application, based on the aforementioned scheme, the synchronization rules are described in the form of regular expressions; the rule matching module 820 is specifically used to traverse each regular expression, find a regular expression that matches the feature code of the order to be synchronized, and use the matched regular expression as the target regular expression of the order to be synchronized; and generate a synchronization task for the order to be synchronized according to the synchronization rule corresponding to the target regular expression.

[0110] In some embodiments of the present application, based on the aforementioned scheme, the message generation module 830 is also used to obtain subscription parameters from the order demander, and the subscription parameters are used to describe the field information subscribed by the order demander; the fields subscribed by the order demander are filtered out from all information fields contained in the order information corresponding to the order to be synchronized, and the filtered fields are used as synchronization fields.

[0111] In some embodiments of the present application, based on the aforementioned scheme, when the synchronization task includes multiple tasks, the message sending module 840 is used to create multiple threads, and the multiple threads are used to execute multiple synchronization tasks in parallel, and send the synchronization field to the order demander according to the receiving address of the order demander contained in the synchronization message; when the synchronization message fails to be sent, the synchronization task corresponding to the synchronization message that failed to be sent is re-executed.

[0112] It should be noted that the apparatus provided in the above embodiment and the method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment and will not be repeated here.

[0113] In an exemplary embodiment, an electronic device includes one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, enable the electronic device to implement the aforementioned method.

[0114] Figure 9 The figure is a schematic structural diagram of an electronic device according to an exemplary embodiment.

[0115] It should be noted that the electronic device is only an example adapted for this application and cannot be considered to provide any limitation on the scope of use of this application. The electronic device cannot be interpreted as needing to rely on or must have Figure 9 One or more components of an exemplary electronic device shown in FIG.

[0116] like Figure 9 As shown in FIG. 1 , in an exemplary embodiment, the electronic device includes a processing component 901, a memory 902, a power supply component 903, a multimedia component 904, an audio component 905, a processor 906, a sensor component 907, and a communication component 908. Not all of the above components are required, and the electronic device may add other components or reduce certain components according to its own functional requirements, which is not limited in this embodiment.

[0117] The processing component 901 generally controls the overall operation of the electronic device, such as operations associated with display, data communication, and log data synchronization. The processing component 901 may include one or more processors 906 to execute instructions to complete all or part of the steps of the above operations. In addition, the processing component 901 may include one or more modules to facilitate interaction between the processing component 901 and other components. For example, the processing component 901 may include a multimedia module to facilitate interaction between the multimedia component 904 and the processing component 901.

[0118] The memory 902 is configured to store various types of data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device. The memory 902 stores one or more modules configured to be executed by the one or more processors 906 to complete all or part of the steps in the method described in the above embodiments.

[0119] The power supply component 903 provides power to various components of the electronic device. The power supply component 903 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device.

[0120] The multimedia component 904 includes a screen that provides an output interface between the electronic device and the user. In some embodiments, the screen may include a TP (Touch Panel) and an LCD (Liquid Crystal Display). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, slides, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation.

[0121] The audio component 905 is configured to output and / or input audio signals. For example, the audio component 905 includes a microphone, and when the electronic device is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive external audio signals. In some embodiments, the audio component 905 also includes a speaker for outputting audio signals.

[0122] The sensor assembly 907 includes one or more sensors for providing status assessments of various aspects of the electronic device. For example, the sensor assembly 907 can detect the on / off state of the electronic device and the temperature change of the electronic device.

[0123] The communication component 908 is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device can access a wireless network based on a communication standard, such as Wi-Fi (Wireless-Fidelity).

[0124] I understand. Figure 9 The structure shown is for illustration only. The electronic device may include Figure 9 More or fewer components as shown, or with Figure 9 Different components are shown. Figure 9 Each component shown in the figure can be implemented by hardware, software or a combination thereof.

[0125] In one exemplary embodiment, a computer-readable storage medium stores a computer program that, when executed by a processor, implements the aforementioned method. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently and not be incorporated into the electronic device.

[0126] It should be noted that the computer-readable storage medium shown in the embodiments of the present application can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.

[0127] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.

[0128] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. Ordinary technicians in this field can easily make corresponding changes or modifications based on the main ideas and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.

Claims

1. An order synchronization method, characterized in that: include: Extracting characteristic information uniquely representing the order from order information corresponding to the order to generate a characteristic code for the order, wherein the order information is used to describe order details, and the characteristic code is used to describe the characteristic information of the order; Determining whether the order is an order to be synchronized according to the feature code of the order; If the order is an order to be synchronized, traverse each regular expression corresponding to the order demander, match the characters of each regular expression with the characters of the feature code of the order to be synchronized, find a regular expression that matches the feature code of the order to be synchronized, and use the matched regular expression as the target regular expression of the order to be synchronized; generate a synchronization task for the order to be synchronized according to the synchronization rule corresponding to the target regular expression; the synchronization task includes the synchronization rule that matches the order; Screening various information of the order information to determine the synchronization fields required by the order demander, and generating a synchronization message containing the synchronization fields; According to the synchronization task, a synchronization message corresponding to the synchronization task is sent to the order demander.

2. The method according to claim 1, characterized in that Before generating the feature code of the order, the method further includes: Establishing multiple message queues according to multiple business channels; the business channels are used to generate and transmit the order information; The order information corresponding to the order is obtained in real time from multiple business channels through the message queue.

3. The method according to claim 2, characterized in that The characteristic information includes at least one of queue name, store code, store type, sales product type, order type, order source, province code, payment type, channel code, drainage information, city code and sales product code.

4. The method according to claim 1, wherein The determining, based on the feature code of the order, whether the order is an order to be synchronized includes: Acquire the filtering configuration of the order demander, where the filtering configuration is used to describe target feature information of the orders that the order demander needs to synchronize; The target feature information is compared with the feature information described by the feature code of the order to determine whether the order corresponding to the feature code is the order to be synchronized.

5. The method according to claim 1, wherein The step of determining the synchronization fields required by the order requester contained in the order information includes: Obtaining subscription parameters from the order requester, where the subscription parameters are used to describe the field information subscribed by the order requester; The fields subscribed by the order demander are screened out from all information fields contained in the order information corresponding to the order to be synchronized, and the screened out fields are used as synchronization fields.

6. The method according to any one of claims 1 to 5, characterized in that When the synchronization task includes multiple tasks, sending the synchronization message to the order requester according to the synchronization task includes: Creating multiple threads, the multiple threads are used to execute multiple synchronization tasks in parallel, and sending the synchronization field to the order demander according to the receiving address of the order demander contained in the synchronization message; When the synchronization message fails to be sent, the synchronization task corresponding to the synchronization message that fails to be sent is re-executed.

7. An order synchronization device, characterized in that: include: An order acquisition module is used to extract characteristic information uniquely representing the order from the order information corresponding to the order to generate a characteristic code for the order, wherein the order information is used to describe the order details and the characteristic code is used to describe the characteristic information of the order; A rule matching module is used to determine whether the order is an order to be synchronized based on the feature code of the order; if the order is an order to be synchronized, traverse each regular expression corresponding to the order demander, match the characters of each regular expression with the characters of the feature code of the order to be synchronized, find a regular expression that matches the feature code of the order to be synchronized, and use the matched regular expression as the target regular expression of the order to be synchronized; generate a synchronization task for the order to be synchronized according to the synchronization rule corresponding to the target regular expression; the synchronization task includes the synchronization rule that matches the order; A message generation module is used to screen various information of the order information to determine the synchronization fields required by the order demander contained in the order information, and generate a synchronization message containing the synchronization fields; The message sending module is used to send the synchronization message corresponding to the synchronization task to the order demander according to the synchronization task.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the electronic device to implement the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Ordering processing method for mobile Internet online payment

    CN103761644A

  • Service providing system, method and device

    CN112927102A