CPS order processing method and device, computer equipment and storage medium
Through a CPS order processing method, using mechanisms such as message queues and interface configuration tables, the problems of time-consuming, labor-intensive and maintenance costs of traditional order access methods are solved, flexible configuration and personalized management are realized, and order processing efficiency is improved. and normative.
Patent Information
- Application Number
- CN202411610079.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2044-11-12
AI Technical Summary
The traditional CPS order access method requires customized development, which is time-consuming and labor-intensive. As the number of channels increases, maintenance costs increase, making it difficult to achieve flexible configuration and personalized management.
Provide a CPS order processing method. By traversing all CPS channels, it determines whether a new order pull cycle has been reached, sends order pull messages to the message queue, requests order information, converts it to a common format, and performs in-store processing, and uses the interface configuration table. , order-pulling rule tables, etc. to realize flexible channel configuration and personalized processing.
It realizes flexible configuration and personalized management of CPS order processing, improves the timeliness and accuracy of order information acquisition, reduces maintenance costs, and improves the efficiency and standardization of the entire order processing process.
Smart Images

Figure CN119444366A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of big data technology, and in particular to a CPS order processing method, computer equipment and storage medium. Background Art
[0002] With the rapid development of e-commerce, competition among e-commerce companies has become increasingly fierce. In order to improve their competitiveness, major e-commerce companies usually promote their products on their platforms in various ways. Among the many promotion methods, CPS (Cost Per Sales) promotion method pays advertising fees to promoters based on actual transaction volume, which reduces promotion costs while ensuring the effect of product promotion. Therefore, CPS has become one of the most popular promotion methods among major e-commerce companies.
[0003] Social e-commerce platforms usually need to cooperate with various CPS channels, such as affiliate marketing platforms, KOLs, social media advertising, etc., but the order formats, data transmission protocols, order throughput, etc. of the channels are different. Traditional order access methods often require customized development, which is time-consuming and labor-intensive, and as the number of channels increases, maintenance costs also increase. Summary of the invention
[0004] The purpose of this application is to solve at least one of the above-mentioned technical deficiencies, and in particular to provide a CPS order processing solution that can be freely configured and universally managed.
[0005] In a first aspect, the present application provides a CPS order processing method, comprising:
[0006] Traverse all connected CPS channels. If the traversed CPS channel is currently pulling orders, continue traversing. Otherwise, determine whether a new order pulling cycle has arrived based on the corresponding order pulling rule table.
[0007] If yes, then send the order pull message corresponding to the traversed CPS channel to the first message queue, otherwise return to the step of traversing all connected CPS channels to continue execution;
[0008] In response to the target order pull message obtained from the first message queue, determining that the CPS channel corresponding to the target order pull message is the first target channel;
[0009] According to the interface configuration table corresponding to the first target channel and the target order pull message, request all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel;
[0010] According to the field mapping table corresponding to the first target channel, the received first order information table is converted into a second order information table having common fields;
[0011] The second order information table is traversed, and the traversed order information is sent to the second message queue for order storage.
[0012] In one of the embodiments, in response to a target order pull message obtained from a first message queue, determining that a CPS channel corresponding to the target order pull message is a first target channel further includes:
[0013] A first identifier corresponding to the first target channel is written into the record database; the first identifier is used to indicate whether the corresponding CPS channel is currently pulling orders.
[0014] After traversing the second order information table and sending the traversed order information to the second message queue for order storage, it also includes:
[0015] The first identifier corresponding to the first target channel is deleted from the record database.
[0016] In one embodiment, the CPS order processing method further includes:
[0017] When traversing to any CPS channel, determine whether there is a corresponding first identifier in the record database;
[0018] If yes, it is determined that the traversed CPS channel is currently pulling orders;
[0019] If not, it is determined that the traversed CPS channel is not pulling orders.
[0020] In one embodiment, after requesting all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel, the method further includes:
[0021] According to the time when the request is sent, the order pull start time corresponding to the first target channel is written into the record database;
[0022] Determine whether the order pull cycle has been reached based on the corresponding order pull rule table, including:
[0023] The set interval value is read from the order pulling rule table, and based on the interval between the order pulling start time of the previous order pulling cycle and the current time and the set interval value, it is determined whether a new order pulling cycle has been reached.
[0024] In one embodiment, after traversing the second order information table and sending the traversed order information to the second message queue for order storage, the method further includes:
[0025] According to the time when the traversal is completed, the order pull end time corresponding to the first target channel is written into the record database;
[0026] Determine the processing time based on the order pull start time and order pull end time corresponding to the first target channel;
[0027] Determine the actual processing speed in the current order pull cycle based on the processing time and the total number of order information;
[0028] Estimate the expected processing speed of the next order-pulling cycle based on the actual processing speed of the current order-pulling cycle and the actual processing speed of the historical order-pulling cycles;
[0029] Estimate the expected processing capacity of the next order pull cycle based on the expected processing speed and the current set interval value;
[0030] If the estimated processing capacity is greater than the estimated total processing volume corresponding to the next order pull cycle, the set interval value will be expanded.
[0031] In one embodiment, the interface configuration table includes interface request information, and the order pull rule table also includes the number of single-page records, which will be written into the order pull message; according to the interface configuration table corresponding to the first target channel and the target order pull message, all order information corresponding to the current order pull cycle is requested from the interface corresponding to the first target channel, including:
[0032] A paginated query method is adopted to encapsulate more than one pull request in sequence and send them to the interface corresponding to the first target channel according to the interface request information, the number of records on a single page and the time corresponding to the current pull cycle; the interface corresponding to the first target channel will feedback the corresponding first order information table for each pull request, and the number of orders contained in the first order information table is less than or equal to the number of records on a single page.
[0033] In one embodiment, the order pull rule table also includes a maximum number of pages, which will be written into the order pull message; a paging query method is adopted, and according to the interface request information, the number of single-page records and the time corresponding to the current order pull cycle, more than one pull request is sequentially encapsulated and sent to the interface corresponding to the first target channel, and further includes:
[0034] If the number of pull requests sent is equal to the maximum number of pages, the pull request of the current pull request cycle is terminated.
[0035] In one embodiment, when the order pulling of the current order pulling cycle is ended, the method further includes:
[0036] The order pulling progress of the current order pulling cycle is recorded, and a supplementary order pulling message corresponding to the first target channel is sent to the third message queue according to the order pulling progress.
[0037] In one embodiment, the CPS order processing method further includes:
[0038] In response to the target supplementary order message obtained from the third message queue, determining that the CPS channel corresponding to the target supplementary order message is the second target channel;
[0039] According to the interface configuration table corresponding to the second target channel and the target supplementary order message, the interface corresponding to the second target channel is requested for the remaining order information of the order pull cycle corresponding to the supplementary order message.
[0040] According to the field mapping table corresponding to the second target channel, the received first order information table is converted into a second order information table having common fields;
[0041] The second order information table is traversed, and the traversed order information is sent to the second message queue for order storage.
[0042] In one embodiment, when the order pulling of the current order pulling cycle is ended, the method further includes:
[0043] If at the end of the current order pulling cycle, it is determined according to the order pulling rule table corresponding to the first target channel that the next order pulling cycle has not yet arrived, the maximum number of pages is increased.
[0044] In one embodiment, the order pull rule table also includes a request interval value, which will be written into the order pull message; a paging query method is adopted, and according to the interface request information, the number of single-page records and the time corresponding to the current order pull cycle, more than one pull request is sequentially encapsulated and sent to the interface corresponding to the first target channel, including:
[0045] A paginated query method is adopted to encapsulate more than one pull request in sequence according to the interface request information, the number of records on a single page, and the time corresponding to the current pull cycle, and send them to the interface corresponding to the first target channel according to the request interval value; in the process of sending each pull request in sequence, if a current limiting prompt is received for the current pull request, the pull interval value is increased, and the pull request is sent starting from resending the current pull request according to the updated pull interval value.
[0046] In one of the embodiments, the field mapping table includes a field correspondence relationship and a type correspondence relationship, the field correspondence relationship is used to reflect the one-to-one correspondence between each field in the first order information table and each field in the second order information table, and the type correspondence relationship is used to reflect the correspondence between the data type of each field in the first order information table and the data type of the corresponding field in the second order information table;
[0047] According to the field mapping table corresponding to the first target channel, the received first order information table is converted into a second order information table with common fields, including:
[0048] Traverse each field of the first order information table, and determine the traversed field as the original field;
[0049] Determine the target field corresponding to the original field according to the field correspondence;
[0050] According to the type correspondence, determine the original field type corresponding to the original field and the target field type corresponding to the target field;
[0051] Select the corresponding type conversion function according to the original field type and the target field type;
[0052] By using the type conversion function, each element under the original field in the first order information table is converted and imported into the target field in the second order information table in sequence.
[0053] In one embodiment, the type conversion function is used to convert each element under the original field in the first order information table and then sequentially import it into the target field in the second order information table, and further includes:
[0054] If a type conversion error message is received, the real field type of the original field is determined according to the type conversion error message;
[0055] In the field correspondence, update the data type of the original field to the real field type.
[0056] In one embodiment, the CPS order processing method further includes:
[0057] Get the interface document of the corresponding interface of the CPS channel;
[0058] Perform semantic matching on the interface document according to the common fields, and generate the field mapping table corresponding to the CPS channel according to the results of the semantic matching.
[0059] In one embodiment, traversing the second order information table and sending the traversed order information to the second message queue for order storage also includes:
[0060] Determine whether commission is required based on the traversed order information and the corresponding business configuration table; if so, generate a corresponding commission message based on the corresponding business configuration table and the order message; and send the commission message to the fourth message queue for commission storage.
[0061] In one embodiment, the CPS order processing method further includes:
[0062] In response to the target order message to be received from the second message queue, determining that the CPS channel corresponding to the target order message to be received is a third target channel;
[0063] Determine whether the third target channel is in the key channel list;
[0064] If yes, import the order information contained in the target order information to be stored into the dedicated data table corresponding to the third target channel; the dedicated data table has the same field structure as the second order information table;
[0065] If not, the order message contained in the target order message to be stored is imported into the general data table; the general data table and the second order information table have the same field structure.
[0066] In a second aspect, the present application provides a CPS order processing device, comprising:
[0067] The first traversal module is used to traverse all the connected CPS channels. If the traversed CPS channel is in the process of pulling orders, the traversal will continue. Otherwise, it will be determined whether a new order pulling cycle has arrived according to the corresponding order pulling rule table.
[0068] The order pull start module is used to send the order pull message corresponding to the traversed CPS channel to the first message queue when a new order pull cycle is reached, otherwise, it returns to the step of traversing all the connected CPS channels to continue execution;
[0069] A first response module, configured to respond to a target order pull message obtained from the first message queue and determine that a CPS channel corresponding to the target order pull message is a first target channel;
[0070] An order request module is used to request all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel according to the interface configuration table corresponding to the first target channel and the target order pull message;
[0071] A field conversion module, used for converting the received first order information table into a second order information table having common fields according to a field mapping table corresponding to the first target channel;
[0072] The second traversal module is used to traverse the second order information table and send the traversed order information to the second message queue for order storage.
[0073] In a third aspect, the present application provides a computer device comprising one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the steps of the CPS order processing method in any of the above embodiments of the claims are executed.
[0074] In a fourth aspect, the present application provides a computer-readable storage medium, which stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the CPS order processing method in any of the above embodiments.
[0075] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0076] The CPS order processing scheme in the embodiment of the present application first traverses all CPS channels, skips the channels that are currently pulling orders, and determines whether a new order pulling cycle has arrived based on the order pulling rule table for those that have not pulled orders. If it has arrived, the corresponding order pulling message is sent to the first message queue. Then, in response to the target order pulling message pulled from the first message queue, its corresponding first target channel is determined, and then all order information of the current order pulling cycle is requested from the corresponding interface according to its interface configuration table and order pulling rule table. Then, according to the field mapping table, the received first order information table is converted into a second order information table with common fields, and finally, this table is traversed to send the order information to the second message queue for warehousing. Through the system's traversal and rule judgment mechanism, this scheme can accurately and timely capture the timing of each CPS channel to pull orders, ensuring the timeliness and accuracy of order information acquisition. The use of message queues to asynchronously process order pulling effectively coordinates the processing order of different links, avoids confusion in information processing, and ensures a smooth process. More importantly, with the help of interface configuration tables, order pulling rule tables, etc., flexible configuration of different CPS channels and personalized order processing are achieved. The field mapping table further realizes the standardized conversion and flexible configuration of order information formats, which facilitates subsequent unified processing, analysis and storage within the system, greatly improving the efficiency and standardization of the entire order processing process. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0078] Figure 1 A flowchart of a CPS order processing method provided in one embodiment of the present application;
[0079] Figure 2 This is a schematic diagram of a process for adjusting a set interval value in one embodiment of the present application;
[0080] Figure 3 This is a flow chart of the process of supplementing an order in one embodiment of the present application;
[0081] Figure 4 A schematic diagram of a process of converting a first order information table into a second order information table in one embodiment of the present application;
[0082] Figure 5 This is a flow chart of distributing commissions on order information in one embodiment of the present application;
[0083] Figure 6This is a schematic diagram of the process of storing order information in an embodiment of the present application;
[0084] Figure 7 An internal structure diagram of a computer device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0085] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, and do not belong to all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0086] This application provides a CPS order processing method, please refer to Figure 1 , including steps S102 to S112.
[0087] S102, traverse all the connected CPS channels, if the traversed CPS channel is in the process of pulling orders, continue to traverse, otherwise determine whether a new order pulling cycle has arrived according to the corresponding order pulling rule table.
[0088] It can be understood that this embodiment can be applied to a social e-commerce platform, which can be connected with multiple CPS channels. Each CPS channel promotes the products or services of this platform in various ways. Only when an actual sales order is generated will the corresponding remuneration be obtained from the merchant or platform. In this embodiment, pulling an order refers to the operation process of obtaining order-related information from a CPS channel. It is similar to going to each cooperative sales point to collect the details of the orders that have been sold, so as to carry out subsequent processing and statistics. In order to systematically check all the docked CPS channels and determine which channels are ready to pull order information. First, check the current status of each CPS channel one by one. If a channel is pulling an order, skip it temporarily and continue to check the next channel, because there is no need to repeat the operation on the channel that is pulling an order at the same time. For those channels that are not currently pulling an order, it is necessary to further determine whether the requirements of the new pull order cycle have been met based on their corresponding pull order rule table. If the new pull order cycle has been reached, it will proceed to step S104. The order-pulling rule table is a pre-set table that specifies in detail the relevant rules for each CPS channel to perform order-pulling operations, such as how often to pull an order (i.e. the order-pulling interval value corresponding to the order-pulling cycle), how to pull an order, etc., to regulate and guide order-pulling behavior.
[0089] In addition, in some embodiments, each docked CPS channel is configured with a one-to-one corresponding channel identifier, and the order-pulling rule table also contains the channel identifier of the corresponding CPS channel. When traversing each CPS channel, if you need to call the corresponding order-pulling rule table for use, you can first determine the channel identifier of the traversed CPS channel, and then retrieve the order-pulling rule table with the same channel identifier based on the determined channel identifier. The order-pulling rule table of each CPS channel can be flexibly configured according to demand, so that personalized orders can be pulled according to the characteristics of each CPS channel. The order-pulling rule table has a corresponding configuration interface, which displays all configurable parameters in the configuration interface. Each parameter is configured with corresponding annotation information to explain the specific content controlled by the corresponding parameter. In this way, non-technical personnel are also able to perform configuration.
[0090] S104: If yes, then send the order pull message corresponding to the traversed CPS channel to the first message queue; otherwise, return to the step of traversing all connected CPS channels and continue to execute.
[0091] It can be understood that when the traversed CPS channel is not currently pulling an order, but has not reached a new pull order cycle (for example, the time interval from the last pull order has not reached the set interval value), it is necessary to continue traversing the next CPS channel, so it is necessary to return to step S102 to continue execution. However, when the traversed CPS channel is not currently pulling an order, and it has also reached a new pull order cycle, it is necessary to pull an order for the CPS channel. In this embodiment, the traversal to determine whether each CPS channel needs to start pulling an order and the actual execution of the pull order task need to be performed asynchronously to achieve the decoupling of the judgment task and the pull task, and improve the flexibility and efficiency of the processing. Therefore, in this embodiment, a first message queue is set to asynchronously process the pull order message. As an intermediate message temporary storage and delivery mechanism, the first message queue can ensure that the pull order message can be processed in order, avoiding the confusion that may be caused by the simultaneous occurrence of multiple pull order requirements.
[0092] Among them, the pull order message is a message in a specific format, which is used to inform the relevant system components that a certain CPS channel has met the pull order conditions and the pull order operation should be started. It contains necessary information about the CPS channel, such as the channel identifier, the parameters related to the interface request in the pull order rule table, and the range of order messages that need to be obtained. So that when the pull order message is subsequently parsed, the pull order operation can be performed according to the parsed content. In addition, regarding the range of order messages that need to be obtained indicated in each pull order message, since a periodic pull order strategy is adopted in this embodiment, the order messages that need to be obtained in each pull order cycle should be all order messages from the moment when the current pull order cycle starts to the moment when the previous pull order cycle starts. When each pull order message is created, the current time can be recorded, and then the creation time of the previous pull order message of this CPS channel can be read out, and these two time points are written into the newly created pull order message. The order information generated between these two time points is the acquisition target of the newly created pull order message.
[0093] S106: In response to the target order pull message obtained from the first message queue, determine that the CPS channel corresponding to the target order pull message is the first target channel.
[0094] It can be understood that the present embodiment can be applied to a distributed system, and the computer device that traverses and determines whether it is necessary to create a pull order message and the computer device that executes the pull order can be the same or different, and there can be multiple computer devices that execute the pull order. For the first message queue, the computer device that creates the pull order message is the producer, and the computer device that executes the pull order is the consumer. Consumers can subscribe to the first message queue, and the first message queue pushes the unconsumed pull order messages to consumers in order. The pull order message received by the consumer is the target pull order message mentioned in this step. When the consumer obtains the target pull order message, it is necessary to clarify the specific CPS channel corresponding to the target pull order message, so as to perform accurate pull order operations for this specific channel later. Specifically, the pull order message may contain a channel identifier of the corresponding CPS channel. By parsing the channel identifier carried in the target pull order message, the first target channel can be determined according to the one-to-one correspondence between the channel identifier and the CPS channel.
[0095] S108, according to the interface configuration table corresponding to the first target channel and the target order pull message, request all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel.
[0096] It can be understood that after the first target channel is determined, in order to obtain all order information corresponding to the current order pull cycle of the channel, it is necessary to operate according to the interface configuration table corresponding to the channel and the order pull rules carried in the target order pull message. The interface configuration table provides information such as the specific method and parameters for interface communication with the channel to ensure that the system can accurately send requests to the interface of the channel. The target order pull message further specifies the rules for obtaining order information, such as the scope of obtaining orders, the method of obtaining them, and so on. By combining the target order pull message and the interface configuration table, the system can issue accurate requests to the interface corresponding to the first target channel to obtain the required order information.
[0097] Specifically, the interface configuration table also includes the channel identifier of the corresponding CPS channel. The first target channel is determined by its channel identifier, so the channel identifier of the first target channel is known. If the corresponding interface configuration table needs to be retrieved for use, the channel identifier of the first target channel can be used to retrieve the interface configuration table with the same channel identifier. The interface configuration table includes the information required to send a request to the order query interface corresponding to the CPS channel, such as the interface address, verification information (account number, key, etc.). The interface configuration table of each CPS channel can be configured according to the information provided by the CPS channel party. It is also possible to open corresponding configuration permissions to the CPS channel, so that when the CPS channel party modifies the relevant settings of the interface, the interface configuration table can be modified adaptively in a timely manner to ensure that the order pull cycle will not be interrupted for a long time due to the modification of the interface.
[0098] S110: Convert the received first order information table into a second order information table having common fields according to the field mapping table corresponding to the first target channel.
[0099] It can be understood that the first order information table refers to the query result returned by the interface of the CPS channel after receiving the pull request, and the first order information table carries the order information specified in the pull request. However, since different CPS channels have different order information formats and field settings, in order to uniformly process and analyze these order information from different channels in the system, it is necessary to convert the received first order information table into a second order information table with common fields. The field mapping table is the key basis for achieving this conversion. The field mapping table records the mapping relationship between the order information field of the CPS channel and the system's common order information field. In other words, it clarifies which field a specific field of the channel corresponds to under the system's common field system, and is used to achieve standardized processing of order information from different channels. By converting each field in the first order information table into a system common field one by one according to the mapping relationship specified in the field mapping table, the second order information table can be obtained, making subsequent processing operations more convenient and standardized.
[0100] S112, traverse the second order information table, and send the traversed order information to the second message queue for order storage.
[0101] It can be understood that after obtaining the second order information table with common fields, the order information therein needs to be processed one by one for warehousing. By traversing the second order information table, each order information can be obtained one by one, and then packaged into warehousing messages and sent to the second message queue. The second message queue will pass these order information to the subsequent system components or modules responsible for the warehousing operation in sequence, so as to ensure that the order information will not be confused during the warehousing process and the warehousing operation can be completed in an orderly manner.
[0102] The CPS order processing scheme in this embodiment first traverses all CPS channels, skips the channels that are currently pulling orders, and determines whether it is a new order pulling cycle based on the order pulling rule table for those that have not pulled orders. If it is, the corresponding order pulling message is sent to the first message queue. Then, it responds to the target order pulling message pulled from the first message queue, determines its corresponding first target channel, and then requests all order information of the current order pulling cycle from the corresponding interface according to its interface configuration table and order pulling rule table. Then, according to the field mapping table, the received first order information table is converted into a second order information table with common fields, and finally, this table is traversed to send the order information to the second message queue for warehousing. Through the system's traversal and rule judgment mechanism, this scheme can accurately and timely capture the timing of each CPS channel to pull orders, ensuring the timeliness and accuracy of order information acquisition. Using message queues to asynchronously process order pulling effectively coordinates the processing order of different links, avoids confusion in information processing, and ensures a smooth process. More importantly, with the help of interface configuration tables, order pulling rule tables, etc., flexible configuration of different CPS channels and personalized order processing are achieved. The field mapping table further realizes the standardized conversion and flexible configuration of order information formats, which facilitates subsequent unified processing, analysis and storage within the system, greatly improving the efficiency and standardization of the entire order processing process.
[0103] In one embodiment, in response to a target order pull message obtained from a first message queue, determining that the CPS channel corresponding to the target order pull message is a first target channel also includes: writing a first identifier corresponding to the first target channel in a record database; the first identifier is used to indicate whether the corresponding CPS channel is currently pulling an order. After traversing the second order information table and sending the traversed order information to the second message queue for order warehousing, it also includes: deleting the first identifier corresponding to the first target channel in the record database.
[0104] It can be understood that after the target order-pulling message is obtained from the first message queue and the corresponding first target channel is determined, the first identifier corresponding to the channel is written into the record database in order to better track and manage the order-pulling status of each CPS channel. In a complex system, there may be multiple CPS channels existing at the same time, and their order-pulling operations may be performed at different time points. By setting such a first identifier and recording it in the database, the system can directly query the identifier information in the record database in any subsequent operation link if it needs to know whether a CPS channel is pulling an order, without having to check the real-time order-pulling situation of the channel again. This helps to improve the overall operating efficiency of the system, avoid repeated status check operations, and also ensure the accuracy and timeliness of the system's judgment on the order-pulling status of each channel. Each first identifier can be written into the channel identifier of the corresponding CPS channel when writing to the record database, which is convenient for querying in the record database. The record database can use the redis database, with the channel identifier as the key and the first identifier as the value to complete the writing of the first identifier.
[0105] If paging is not used when requesting all order information for this order-pulling cycle, the interface will collect all order information in the same first order information table and return it, and there will be only one second order information table that needs to be processed. After traversing the second order information table, the work of this order-pulling cycle is completed, and the first identifier corresponding to the target channel in the record database can be deleted. However, sometimes paging query is used for query efficiency, and multiple requests are sent to the interface separately, each time returning a first order information table corresponding to a page. At this time, there will be multiple second order information tables that need to be processed, so it is necessary to wait until all second order information tables are traversed before deleting the first identifier.
[0106] In one of the embodiments, the CPS order processing method further includes: when traversing to any CPS channel, determining whether there is a corresponding first identifier in the record database; if so, determining that the traversed CPS channel is currently pulling orders; if not, determining that the traversed CPS channel is not currently pulling orders.
[0107] It can be understood that in the process of traversing each CPS channel in step S102, it is necessary to determine whether the traversed CPS channel is currently pulling orders. When the first identifier is used to mark the order pulling status of each CPS channel, it is possible to query whether there is a corresponding first identifier in the record database. If there is, it means that an order is being pulled, otherwise it is determined that an order is not being pulled. Specifically, when traversing any CPS channel, the channel identifier of the CPS channel is obtained, and the record database is queried according to the obtained channel identifier, and whether an order is being pulled is determined according to the presence or absence of the first identifier in the query result.
[0108] In one embodiment, the order pull rule table includes a set interval value. After requesting all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel, the method further includes: writing the order pull start time corresponding to the first target channel into the record database according to the time when the request is sent.
[0109] It is understandable that in the entire CPS order processing process, accurately grasping the time of each order-pulling operation is crucial for the reasonable arrangement of subsequent order-pulling cycles and the order-pulling order processing order. When the first request is successfully sent to the interface corresponding to the first target channel during the process of processing the target order-pulling message, the time of the operation is marked as the order-pulling start time and recorded in the database, providing an exact starting time benchmark for the subsequent judgment of whether a new order-pulling cycle has been reached.
[0110] Based on the order pull start time recorded in each order pull cycle, when it is necessary to determine whether the order pull cycle has been reached according to the corresponding order pull rule table in step S102, the set interval value can be read from the order pull rule table, and based on the interval between the corresponding order pull start time and the current time and the set interval value, it can be determined whether a new order pull cycle has been reached.
[0111] In one embodiment, after traversing the second order information table and sending the traversed order information to the second message queue for order storage, refer to Figure 2 , also including steps S202 to S212.
[0112] S202: Write the order completion time corresponding to the first target channel into the record database according to the time when the traversal is completed.
[0113] It can be understood that in the CPS order processing process, accurately recording the end time of the order is crucial to fully understand the time span of each order operation. When all the second order information tables of this order cycle are traversed, the current time is recorded and used as the end time of the order. The end time of the order forms a complete time interval with the previously recorded start time of the order, which is convenient for subsequent calculation of relevant parameters such as processing time. By writing the end time of the order in the record database, the system can accurately track the entire process from the beginning to the end of each order operation of each first target channel, and provide an accurate time data basis for further analysis of processing efficiency, optimization of the order cycle, etc. In the record database, a data table can be created for each CPS channel, and the data table can use the channel identifier corresponding to the CPS channel as an index. The data table may include fields corresponding to the first identifier, the start time of the order and / or the end time of the order, and data recording can be realized by writing corresponding values in the corresponding fields of the data table. When calling, the corresponding data table can also be found with the channel identifier as the index, and the required data can be extracted from the corresponding field.
[0114] S204: Determine the processing time according to the order pull start time and order pull end time corresponding to the first target channel.
[0115] It can be understood that by obtaining the order pull start time and order pull end time of the first target channel in this order pull cycle, the processing time can be accurately calculated using these two time nodes. This time consumption data can intuitively reflect the time cost spent by the system in processing the channel order information in this order pull cycle.
[0116] S206, determining the actual processing speed in the current order pulling cycle according to the processing time and the total amount of order information.
[0117] It can be understood that the total number of order information refers to the number of all order information obtained from the first target channel in this order pull cycle, which can be obtained by traversing the second order information table and other operations. The actual processing speed of the current order pull cycle can be obtained by dividing the total number of order information by the processing time, which serves as a reference standard for subsequent optimization.
[0118] S208, estimating the expected processing speed of the next order pulling cycle based on the actual processing speed of the current order pulling cycle and the actual processing speed of the historical order pulling cycles.
[0119] It can be understood that estimating the expected processing speed of the next order-pulling cycle is of great significance for the reasonable arrangement of the next order-pulling operation, optimizing the system resource allocation, and ensuring the continuity and efficiency of order processing. The expected processing speed is calculated and recorded in each order-pulling cycle. The actual processing speed field can be set in the data table corresponding to each CPS channel of the record database, and the corresponding value can be written in the corresponding field of the data table to realize data recording. When it is necessary to call, the corresponding data table can be found with the channel identifier as the index, and then the required data can be extracted from the corresponding field. By analyzing the actual processing speed of the current order-pulling cycle and the actual processing speed of the historical order-pulling cycle, the expected processing speed of the next order-pulling cycle can be comprehensively predicted. It can be started from the current order-pulling cycle, and a preset number of order-pulling cycles are selected forward for analysis, and a larger weight is assigned to the order-pulling cycle closer to the current order-pulling cycle, and their actual processing speeds are weighted and averaged to obtain the expected processing speed of the next order-pulling cycle.
[0120] S210, estimating the expected processing capacity of the next order pulling cycle based on the expected processing speed and the current set interval value.
[0121] It can be understood that it refers to the total amount of order information that the system can process in the next order-pulling cycle, based on the expected processing speed and the set interval value. It reflects the system's processing capacity in the next order-pulling cycle. Estimating the expected processing capacity of the next order-pulling cycle helps the system plan resources in advance, arrange work processes, and ensure smooth order processing. The expected processing capacity obtained by multiplying the expected processing speed with the current set interval value reflects the total amount of order information that can be processed in the next order-pulling cycle if the operation is carried out according to the expected processing speed. In this way, possible insufficient or excessive processing capacity can be discovered in advance, so that the set interval value can be adjusted in time, the processing flow can be optimized, etc., thereby improving the overall efficiency and stability of the system.
[0122] S212: If the estimated processing capacity is greater than the estimated total processing volume corresponding to the next order-pulling cycle, the set interval value is enlarged.
[0123] It can be understood that when the estimated processing capacity is greater than the estimated total processing volume corresponding to the next order-pulling cycle, it means that the system may process too much order information if the order-pulling operation is performed according to the current set interval value, which may lead to resource waste (such as unnecessary frequent order-pulling consuming system resources, etc.). By increasing the set interval value, the frequency of order-pulling can be reduced, and more order information can be included in the order-pulling target of the next order-pulling cycle, so that the system can use resources more reasonably when processing order information, and can also better adapt to changes in business needs and order volume, thereby improving the overall efficiency and stability of the system. The specific way to expand can be to expand at a fixed ratio.
[0124] In one of the embodiments, the interface configuration table includes interface request information, and the order pull rule table also includes the number of single-page records, which will be written into the order pull message. According to the interface configuration table and the target order pull message corresponding to the first target channel, all order information corresponding to the current order pull cycle is requested from the interface corresponding to the first target channel, including: taking a paging query method, according to the interface request information, the number of single-page records and the time corresponding to the current order pull cycle, one or more pull requests are encapsulated in sequence and sent to the interface corresponding to the first target channel. The interface corresponding to the first target channel will feedback the corresponding first order information table for each pull request, and the number of orders contained in the first order information table is less than or equal to the number of single-page records.
[0125] It can be understood that this embodiment specifically adopts the paging query method to pull orders from the interface corresponding to the first target channel. Paging query requires encapsulating one or more pull requests and sending them to the interface corresponding to the first target channel in sequence. Among them, since the interface configuration table provides basic information for communicating with the interface, all relevant information needs to be extracted from the interface configuration table when encapsulating the pull request to ensure that the request can be correctly sent to the target interface. The number of single-page records in the pull rule table limits the scale of data returned by each query. This has several advantages: first, it avoids problems such as excessive system resource occupation and long response time that may be caused by obtaining a large amount of data at one time; second, it facilitates orderly management and processing of the acquired data. The number of single-page records is written into the pull message so that when performing the pull operation, the relevant components can clearly know the scale limit of each query. Writing the time corresponding to the current pull cycle in the pull message is to clarify the range of order information that needs to be obtained. The time corresponding to the current pull cycle can be specifically the time period between the time when the previous pull message of the first target channel was created and the time when the latest pull message was created. Paging query can specifically use the limit clause in the SQL statement to set the number of single-page records, and the offset clause to specify which record to continue to obtain. After receiving each pull request, the interface corresponding to the first target channel will feedback the corresponding first order information table according to the limit of the number of records on a single page, ensuring that the number of orders returned each time does not exceed the number of records on a single page. This can not only meet the needs of obtaining all order information, but also ensure the stability and controllability of the data acquisition process.
[0126] In one embodiment, the order pull rule table also includes a maximum number of pages, which will be written into the order pull message. In a paging query method, according to the interface request information, the number of single-page records and the time corresponding to the current order pull cycle, more than one pull request is sequentially encapsulated and sent to the interface corresponding to the first target channel, and further includes: if the number of pull requests sent is equal to the maximum number of pages, the order pull of the current order pull cycle is terminated.
[0127] It can be understood that the maximum number of pages is a parameter in the order pull rule table, which is used to limit the maximum number of pages that can be divided when performing paging query to obtain order information. It clarifies the upper limit of the number of times to obtain order information from the CPS channel interface through paging query in the current order pull cycle. Once this upper limit is reached, it means that this order pull operation should come to an end in the link of obtaining order information. The maximum number of pages is used because the number of orders in some order pull cycles may be particularly large. If the order is pulled all the time, it may still be in the order pull state when the next order pull cycle arrives and the new order pull cycle cannot be started, which will cause problems in the entire cycle. Therefore, in the process of paging query, each pull request sent is equivalent to completing a query attempt for one page of data. As the pull requests are sent one by one, the number of pull requests sent will continue to increase. When this number reaches the maximum number of pages, it means that according to the pre-set rules, enough attempts have been made to obtain order information. At this time, the order pull operation of the current order pull cycle should be ended to avoid affecting the start of the next order pull cycle.
[0128] In one of the embodiments, when the order pulling of the current order pulling cycle is ended, it also includes: recording the order pulling progress of the current order pulling cycle, and sending a supplementary order pulling message corresponding to the first target channel to the third message queue according to the order pulling progress.
[0129] It can be understood that when the order pull cycle ends because the number of pull requests sent is equal to the maximum number of pages, this order pull cycle is ended in advance, and some order information is still not pulled. Therefore, in order to ensure the integrity and accuracy of order data, it is particularly important to record the order pull progress when the current order pull cycle ends. By recording the order pull progress, you can clearly know the degree of completion of the current order pull operation, thereby providing a basis for subsequent supplementary order pull operations.
[0130] Sending a supplementary order message corresponding to the first target channel to the third message queue can pass the supplementary order demand to the relevant system components or modules. After receiving the supplementary order message, these components or modules can perform targeted supplementary order operations based on the information in the message (such as channel identification and order progress) to obtain as much order information as possible that was missed or failed to be successfully obtained during the initial order process, thereby improving the integrity and reliability of order processing. Recording the order progress of the current order cycle here can include recording the time range corresponding to the current order cycle and the value in the above offset clause.
[0131] In one embodiment, see Figure 3 , the CPS order processing method also includes steps S302 to S308.
[0132] S302: In response to a target supplementary order message obtained from a third message queue, determine that a CPS channel corresponding to the target supplementary order message is a second target channel.
[0133] It can be understood that this embodiment can be applied to a distributed system, and the computer device that traverses to determine whether it is necessary to create a pull order message, the computer device that executes the pull order, and the computer device that executes the supplementary pull order can be the same or different, and there can be multiple computer devices that execute the supplementary pull order. For the third message queue, the computer device that creates the supplementary pull order message is the producer, and the computer device that executes the supplementary pull order is the consumer. Consumers can subscribe to the third message queue, and the third message queue pushes the unconsumed supplementary pull order messages to consumers in order. The supplementary pull order message received by the consumer is the target supplementary pull order message mentioned in this step. When the consumer obtains the target supplementary pull order message, it is necessary to clarify the specific CPS channel corresponding to the target supplementary pull order message, so as to perform accurate supplementary pull order operations for this specific channel later. Specifically, the supplementary pull order message may contain a channel identifier of the corresponding CPS channel. By parsing the channel identifier carried in the target supplementary pull order message, the second target channel can be determined according to the one-to-one correspondence between the channel identifier and the CPS channel.
[0134] S304: According to the interface configuration table corresponding to the second target channel and the target supplementary order message, the interface corresponding to the second target channel is requested to obtain the remaining order information of the order pull cycle corresponding to the supplementary order message.
[0135] It can be understood that after the second target channel is determined, in order to obtain the remaining order information that is missed due to the early termination of the channel, it is necessary to operate according to the interface configuration table corresponding to the channel and the order pulling rules and order pulling progress carried in the target supplementary order pulling message. The interface configuration table provides information such as the specific method and parameters for interface communication with the channel to ensure that the system can accurately send requests to the interface of the channel. The target supplementary order pulling message further specifies the rules for obtaining order information, such as the scope of obtaining orders, the method of obtaining orders, and the progress of the previous order pulling, etc. By combining the target supplementary order pulling message and the interface configuration table, the system can send accurate requests to the interface corresponding to the second target channel to obtain the required order information.
[0136] Specifically, the interface configuration table also includes the channel identifier of the corresponding CPS channel. The second target channel is determined by its channel identifier, so the channel identifier of the second target channel is known. If the corresponding interface configuration table needs to be retrieved for use, the channel identifier of the second target channel can be used to retrieve the interface configuration table with the same channel identifier. The interface configuration table includes the information required to send a request to the order query interface corresponding to the CPS channel, such as the interface address, verification information (account number, key, etc.). The interface configuration table of each CPS channel can be configured according to the information provided by the CPS channel party. The corresponding configuration permissions can also be opened to the CPS channel, so that when the CPS channel party modifies the relevant settings of the interface, the interface configuration table can be modified in a timely and adaptive manner to ensure that the order pull cycle will not be interrupted for a long time due to the modification of the interface.
[0137] S306: Convert the received first order information table into a second order information table with common fields according to the field mapping table corresponding to the second target channel.
[0138] S308, traverse the second order information table, and send the traversed order information to the second message queue for order storage.
[0139] The description of step S306 and step S308 may refer to the description of step S110 and step S112 .
[0140] In one of the embodiments, when the current order pulling cycle ends, it also includes: if at the end of the current order pulling cycle, it is determined according to the order pulling rule table corresponding to the first target channel that the next order pulling cycle has not yet arrived, then the maximum number of pages is increased.
[0141] It can be understood that in the CPS order processing process, the order pulling operation is carried out regularly according to the order pulling cycle. When the current order pulling cycle ends, if it is judged according to the order pulling rule table corresponding to the first target channel that the next order pulling cycle has not yet arrived, and the current order pulling cycle is ended early because the number of pull requests sent is equal to the maximum number of pages, this means that the current maximum number of pages is set unreasonably and the time of the current order pulling cycle is not fully utilized. By increasing the maximum number of pages, more pull requests can be sent when the next order pulling operation adopts the paging query method, so that the time of the order pulling cycle can be more fully utilized and the need to supplement the order can be reduced. The increase in the maximum number of pages can be increased proportionally or by a fixed value.
[0142] In one of the embodiments, the pull order rule table also includes a request interval value, which will be written into the pull order message. A paging query method is adopted, and according to the interface request information, the number of single-page records and the time corresponding to the current pull order cycle, more than one pull request is sequentially encapsulated and sent to the interface corresponding to the first target channel, including: a paging query method is adopted, and according to the interface request information, the number of single-page records and the time corresponding to the current pull order cycle, more than one pull request is sequentially encapsulated and sent to the interface corresponding to the first target channel according to the request interval value. In the process of sending each pull request in sequence, if a current limiting prompt is received for the current pull request, the pull interval value is increased, and the pull request is sent according to the updated pull interval value starting from resending the current pull request.
[0143] It can be understood that the request interval value is a parameter in the pull order rule table, which is used to determine the length of time that should be spaced between two adjacent requests when sending a pull request to the interface corresponding to the first target channel. It is measured in time units, and its purpose is to avoid sending requests to the interface too frequently, prevent excessive pressure on the server where the interface is located, and also ensure the orderliness of data acquisition. In the process of actually sending a pull request, you may encounter a current limiting prompt returned by the interface server. This indicates that the current request frequency has exceeded the upper limit set by the interface. In order to continue to successfully obtain order information, it is necessary to adjust the request frequency. At this time, increasing the pull interval value is to reduce the request frequency so that it meets the requirements of the server, so that pull requests can continue to be sent to obtain the required data, and at the same time avoid the situation where data acquisition is incomplete or failed due to frequent triggering of current limiting. In addition, when sending pull requests in sequence, the pull request that triggers the current limiting prompt does not successfully pull the data. Therefore, after adjusting the pull interval value, it is necessary to resend the current pull request and try to obtain it again. The step of increasing the pull interval value in this embodiment can also be triggered in the process of supplementing the pull order, which will not be repeated here.
[0144] In one embodiment, the field mapping table includes field correspondence and type correspondence. The field correspondence is used to reflect the one-to-one correspondence between each field in the first order information table and each field in the second order information table. The type correspondence is used to reflect the correspondence between the data type of each field in the first order information table and the data type of the corresponding field in the second order information table. Figure 4 , according to the field mapping table corresponding to the first target channel, the received first order information table is converted into a second order information table with common fields, including steps S402 to S410.
[0145] S402, traverse each field of the first order information table, and determine the traversed field as the original field.
[0146] It can be understood that in the process of traversing the first order information table, each field currently being accessed is defined as an original field. These original fields are the basic objects for subsequent conversion operations, and they carry the original order information data obtained from the first order information table. In order to convert the first order information table into a second order information table that conforms to the general format of the system, it is first necessary to comprehensively sort out and identify the various fields of the first order information table. By traversing each of its fields, each original field that needs to be converted can be determined one by one, thereby laying the foundation for the operation.
[0147] S404, determining the target field corresponding to the original field according to the field correspondence relationship.
[0148] It can be understood that the field correspondence relationship clarifies what the target field is that corresponds to each original field in the first order information table under the system's general order information format. For example, the "channel_order_id" field in the first order information table may correspond to the "system_order_id" field under the system's general format. This one-to-one correspondence is the field correspondence relationship. It can be seen that the target field is the field that corresponds to it in the system's general order information format that is found from the original field in the first order information table based on the field correspondence relationship. When the original field is determined, by looking up the field correspondence relationship in the field mapping table, the target field that each original field should correspond to in the system's general format can be accurately found. In this way, it is clear under which general field the data in the original field should be placed after conversion, thereby achieving the unification of order information from different channels at the field level.
[0149] S406: Determine the original field type corresponding to the original field and the target field type corresponding to the target field according to the type correspondence.
[0150] It can be understood that the type correspondence relationship clarifies the correspondence between the original field type in the first order information table and the target field type in the second order information table that is common to the system. For example, the original field "quantity" is an integer type, and the corresponding target field "system_quantity" in the system common format is a floating point type. This correspondence relationship about data types is the type correspondence relationship. The original field type refers to the data type of the original field in the first order information table, such as string, integer, floating point, date, etc. It determines the form in which the data under the original field is stored and processed. The target field type is the data type of the target field found for the original field type according to the type correspondence relationship. In other words, it is the data type that the converted data should have under the target field. In the process of converting the first order information table to the second order information table, in addition to determining the correspondence relationship of the fields, it is also necessary to clarify the data type correspondence relationship of the fields. Because the order information of different channels may have inconsistent data types, for example, the order amount of a certain channel may be stored in the form of a string, while the system common format requires it to be stored in the form of a floating point. By determining the original field type corresponding to the original field and the target field type corresponding to the target field, a suitable type conversion function can be selected according to this type correspondence.
[0151] S408: Select a corresponding type conversion function according to the original field type and the target field type.
[0152] It can be understood that a type conversion function is a function used in a programming language to convert one data type to another data type. Different programming languages have their own series of type conversion functions. Once the original field type and the target field type are determined, it is necessary to select an appropriate type conversion function to achieve the correct conversion of data from the original field to the target field. Because there may be format differences between different data types, for example, to convert a string type number to an integer type, a special type conversion function is required to perform the conversion operation. By selecting an appropriate type conversion function, the data under the original field can be accurately converted to the type required by the target field according to the specific circumstances of the original field type and the target field type, so that the converted order information can meet the requirements of the system's general format.
[0153] S410, using a type conversion function, converting each element under the original field in the first order information table and importing them into the target field of the second order information table in sequence.
[0154] It can be understood that the last step is to use the selected type conversion function to convert the elements under the original field in the first order information table, and import the converted results into the target field of the second order information table in sequence. In this way, a complete conversion from the first order information table to the second order information table is achieved, so that the order information is converted from the format based on the first target channel to the system general format, which facilitates the subsequent system to uniformly process, analyze and store the order information, and improves the efficiency and standardization of the system in processing order information. The method in this embodiment can be used both in the process of pulling orders and in the process of supplementing orders.
[0155] In one embodiment, a type conversion function is used to convert each element under the original field in the first order information table and then import it into the target field of the second order information table in sequence, and further includes: if a type conversion error message is received, the real field type of the original field is determined according to the type conversion error message. In the field correspondence, the data type of the original field is updated to the real field type.
[0156] It can be understood that in actual situations, due to the complexity of the data source and various possible non-standard factors, the type correspondence actually used may be wrong, resulting in the selection of the wrong type conversion function in step S408, so it is very likely to encounter a type conversion error when executing the type conversion function. When a type conversion error message is received, the type conversion error message will indicate the real data type of the data to be converted, and the format of the type conversion error message is known. Based on this specific format, keywords related to the real data type can be found and extracted. For example, when a DataFormatException or a numeric type conversion exception is encountered in a Java application, the exception stack trace (stacktrace) will provide detailed error information. Suppose you are processing a string and trying to convert it to an integer, but a NumberFormatException is triggered due to an incorrect string format. The information will include: java.lang.NumberFormatException: For input string: "123abc". Among them, the part after For input: is the real data type of the data to be converted, and the required real data type can be found based on this format. Once the real field type is determined, the data type of the original field needs to be updated in the field correspondence. The method in this embodiment can be used in the process of pulling an order or in the process of pulling a supplementary order.
[0157] In one embodiment, the CPS order processing method further includes: obtaining an interface document of an interface corresponding to a CPS channel, performing semantic matching on the interface document according to common fields, and generating a field mapping table corresponding to the CPS channel according to the result of the semantic matching.
[0158] It can be understood that in order to accurately process the order information obtained from the CPS channel and convert it into a system-wide format, it is first necessary to have an in-depth understanding of the relevant specifications and data structures of the corresponding interfaces of the CPS channel, and the interface document is an important source for obtaining these key information. By obtaining the interface document, the system can clearly know the various requirements and specific conditions of the returned data when the interface interacts with the channel, which lays the foundation for the subsequent generation of the field mapping table and the entire order processing process. The interface document is generally provided by the CPS channel party. The interface document adds semantic descriptions to each field of the first order information table, and the platform party using the method of this application can also add semantic descriptions to each common field of the second order information table. The description of the interface document and the second order information table is input into the large language model, instructing it to find field pairs with similar semantics, and then determine the mapping relationship between them, and finally generate a preliminary field mapping table. There may be problems with the field mapping table directly generated by the large language model, which can be further modified by the technician in the preliminary field mapping table.
[0159] In one embodiment, see Figure 5 , traverse the second order information table, send the traversed order information to the second message queue for order warehousing, and also include steps S502 to S506.
[0160] S502: Determine whether commission distribution is required based on the traversed order information and the corresponding business configuration table.
[0161] It can be understood that commission sharing is a process in which, when an order is completed, the revenue generated by the order is distributed to relevant participants (such as promoters, channels, etc.) according to a certain proportion according to pre-set rules under the CPS (pay per sale) model. Here, it is necessary to determine whether each order meets the conditions for such revenue distribution. In the entire CPS order processing process, not all orders need to be commissioned. Different orders may have different commission requirements due to various factors (such as order source, product type, customer attributes, etc.). By analyzing and judging each traversed order information, only by clarifying which orders need commission sharing can we generate corresponding commission sharing messages for these orders in a targeted manner and perform subsequent operations such as warehousing. Obtain the traversed order information from the second order information table. Assume that the second order information table is a list structure composed of dictionaries. Each order information exists in the form of a dictionary, which contains common fields such as "order source channel", "product category", and "order amount". You can set a series of judgment conditions to determine whether commission sharing is required. For example, according to business rules, if the order source channel is a specific promotion channel, and the product category belongs to the category of commissionable products. These judgment conditions are all set in the business configuration table. The business configuration table of each CPS channel can be flexibly configured according to needs, so that personalized orders can be pulled according to the characteristics of each CPS channel. The business configuration table has a corresponding configuration interface, which displays all configurable parameters. Each parameter is configured with corresponding annotation information to explain the specific content controlled by the corresponding parameter. In this way, non-technical personnel are also able to perform configuration. In addition, the correspondence mentioned here refers to the business configuration table corresponding to the first target channel in the process of pulling orders. In the process of supplementary pulling orders, it refers to the business configuration table corresponding to the second target channel.
[0162] S504: If yes, generate a corresponding commission message according to the corresponding business configuration table and order message.
[0163] It can be understood that when it is determined that a certain order needs to be commissioned, in order to accurately perform the commission operation, it is necessary to generate a commission message based on the corresponding business configuration table and order message. The business configuration table provides detailed rules and configuration information about the commission of the channel, such as the commission ratio and the objects to be distributed. The order message (which can be understood as the content contained in the order information currently traversed) provides relevant data of the specific order, such as the order amount. By combining these two aspects of information, it is possible to accurately calculate the amount of commission that each commission object should receive, and organize this information into a commission message format that meets the requirements, so that it can be subsequently passed to related processing links such as commission warehousing to ensure the accuracy and standardization of the commission operation.
[0164] S506: Send the commission message to the fourth message queue for commission storage.
[0165] It can be understood that the fourth message queue is similar to the first message queue, the second message queue, etc. mentioned above. It is a message transmission middleware mechanism, which is specially used to receive and temporarily store messages related to commissions, and plays a role of buffering and coordination, ensuring that the commission messages can be processed in order and realizing the accurate storage of commission information. It means that the commission-related information (such as commission objects, commission amounts, commission ratios, etc.) contained in the commission messages are accurately stored in storage media such as databases, so as to facilitate subsequent queries, statistics and other operations, complete the last step of the commission process, and ensure the integrity and traceability of the commission data. After the accurate commission message is generated, it needs to be sent to the fourth message queue for commission storage operations. As a message transmission middleware, the fourth message queue can ensure the orderliness and stability of the commission message during the transmission process, and avoid message loss or processing confusion due to concurrency and other problems. When the commission message enters the fourth message queue, the relevant system components or modules will obtain the message from the queue, and accurately store the information in the commission message into a storage medium such as a database according to the predetermined storage process, thereby completing the storage operation of the commission information, so that the commission data can be effectively managed and used by the system, which is convenient for subsequent query, statistics and other analysis of the commission situation. The method in this embodiment can be used in the process of pulling orders, and can also be used in the process of supplementing orders.
[0166] In one embodiment, see Figure 6 , the CPS order processing method also includes steps S602 to S608.
[0167] S602: In response to the target order message to be received from the second message queue, determine that the CPS channel corresponding to the target order message to be received is a third target channel.
[0168] It can be understood that the second message queue will successively receive pending order messages from different CPS channels. When the system component obtains a target pending order message from this queue, it is necessary to clarify the specific CPS channel corresponding to this message, so as to perform accurate order entry operations for this specific channel in the future. By parsing the relevant information in the target pending order message, such as the channel identifier, etc., it is possible to determine the CPS channel targeted by this message, which is the third target channel. In this way, the subsequent order entry operations can be carried out around this third target channel, ensuring the pertinence and accuracy of the operation, and ensuring that the order information can be accurately stored in the database table corresponding to the channel.
[0169] S604, determining whether the third target channel is in the key channel list.
[0170] It can be understood that in the CPS order processing process, in order to better manage and process the order information of different CPS channels, key channels are divided according to business needs and recorded in the key channel form. In the order entry stage, judging whether the third target channel is in the key channel form is to determine whether a special entry method is required for the order information of the channel. If the channel is a key channel, its order information needs to be stored in a database table specially set up for it, so that when performing subsequent analysis, statistics and other operations, the dedicated data table can be quickly retrieved according to the channel identifier. If it is not a key channel, the order information can be stored in a general data table to simplify the processing flow and save resources.
[0171] S606: If yes, import the order information contained in the target order information to be stored into the dedicated data table corresponding to the third target channel. The dedicated data table has the same field structure as the second order information table.
[0172] It can be understood that the dedicated data table is a database table specially set up for the key CPS channel, which is used to store the order information of the channel. The dedicated data table can be retrieved through the channel identifier of the corresponding CPS channel. Since key channels may have special business needs, such as more frequent data analysis, specific business report generation, etc., setting up a dedicated data table for it can facilitate more accurate processing and analysis of the order information of the channel in the future.
[0173] S608, if not, import the order information contained in the target order information to be stored into the general data table. The general data table has the same field structure as the second order information table.
[0174] It can be understood that the general data table is a database table used to store order information of non-key CPS channels. It is a relatively general storage medium used to store order information that does not require special processing. The number of orders from these non-key channels is not so large, so using a unified general data table to store will not have a great impact on retrieval efficiency. In addition, both the general data table and the special data table have the same field structure as the second order information table, so no additional processing is required when entering the warehouse, which improves the efficiency of entering the warehouse.
[0175] The present application provides a CPS order processing device, including a first traversal module, an order-pulling initiation module, a first response module, an order-pulling request module, a field conversion module and a second traversal module.
[0176] The first traversal module is used to traverse all the docked CPS channels. If the traversed CPS channel is currently pulling orders, the traversal will continue. Otherwise, it will be determined whether a new pull order cycle has been reached according to the corresponding pull order rule table. The pull order startup module is used to send the pull order message corresponding to the traversed CPS channel to the first message queue when a new pull order cycle has been reached. Otherwise, it will return to the step of traversing all the docked CPS channels and continue to execute. The first response module is used to respond to the target pull order message obtained from the first message queue and determine that the CPS channel corresponding to the target pull order message is the first target channel. The pull order request module is used to request all order information corresponding to the current pull order cycle from the interface corresponding to the first target channel according to the interface configuration table and the target pull order message corresponding to the first target channel. The field conversion module is used to convert the received first order information table into a second order information table with common fields according to the field mapping table corresponding to the first target channel. The second traversal module is used to traverse the second order information table and send the traversed order information to the second message queue for order warehousing.
[0177] For the specific limitations of the CPS order processing device, please refer to the limitations of the CPS order processing method above, which will not be repeated here. Each module in the above-mentioned CPS order processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0178] The present application provides a computer device, including one or more processors and a memory, wherein the memory stores computer-readable instructions. When the computer-readable instructions are executed by the one or more processors, the steps of the CPS order processing method in any of the above embodiments are executed.
[0179] Indicatively, Figure 7 As shown, Figure 7 A schematic diagram of the internal structure of a computer device provided in an embodiment of the present application. Figure 7 The computer device 700 includes a processing component 702, which further includes one or more processors, and a memory resource represented by a memory 701 for storing instructions executable by the processing component 702, such as an application. The application stored in the memory 701 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 702 is configured to execute instructions to perform the steps of the CPS order processing method of any of the above embodiments.
[0180] The computer device 700 may further include a power supply component 703 configured to perform power management of the computer device 700 , a wired or wireless network interface 704 configured to connect the computer device 700 to a network, and an input / output (I / O) interface 705 .
[0181] The present application provides a computer-readable storage medium, in which computer-readable instructions are stored. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the CPS order processing method in any of the above embodiments.
[0182] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0183] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can refer to each other.
[0184] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A CPS order processing method, characterized in that: include: Traverse all connected CPS channels. If the traversed CPS channel is currently pulling orders, continue traversing. Otherwise, determine whether a new order pulling cycle has arrived according to the corresponding order pulling rule table. If yes, then send the order pull message corresponding to the traversed CPS channel to the first message queue, otherwise return to the step of traversing all the connected CPS channels and continue to execute; In response to the target order pull message obtained from the first message queue, determining that the CPS channel corresponding to the target order pull message is a first target channel; According to the interface configuration table corresponding to the first target channel and the target order pulling message, requesting all order information corresponding to the current order pulling cycle from the interface corresponding to the first target channel; According to the field mapping table corresponding to the first target channel, converting the received first order information table into a second order information table having common fields; The second order information table is traversed, and the traversed order information is sent to the second message queue for order storage.
2. The CPS order processing method according to claim 1, characterized in that: In response to the target order pull message obtained from the first message queue, determining that the CPS channel corresponding to the target order pull message is a first target channel also includes: Writing a first identifier corresponding to the first target channel into the record database; the first identifier is used to indicate whether the corresponding CPS channel is currently pulling orders; After traversing the second order information table and sending the traversed order information to the second message queue for order storage, the method further includes: The first identifier corresponding to the first target channel is deleted from the record database.
3. The CPS order processing method according to claim 2, characterized in that: Also includes: When traversing to any of the CPS channels, determining whether there is a corresponding first identifier in the record database; If yes, it is determined that the traversed CPS channel is currently pulling orders; If not, it is determined that the traversed CPS channel is not pulling orders.
4. The CPS order processing method according to claim 1, characterized in that: After requesting all order information corresponding to the current order pulling cycle from the interface corresponding to the first target channel, the method further includes: According to the time when the request is sent, the order pull start time corresponding to the first target channel is written into the record database; The step of judging whether the order pulling cycle has been reached according to the corresponding order pulling rule table includes: The set interval value is read from the order pulling rule table, and based on the interval between the order pulling start time of the previous order pulling cycle and the current time and the set interval value, it is determined whether the new order pulling cycle has been reached.
5. The CPS order processing method according to claim 4, characterized in that: After traversing the second order information table and sending the traversed order information to the second message queue for order storage, the method further includes: According to the time when the traversal is completed, the order pulling end time corresponding to the first target channel is written into the record database; Determine the processing time according to the order pulling start time and the order pulling end time corresponding to the first target channel; Determine the actual processing speed in the current order pulling cycle according to the processing time and the total amount of the order information; According to the actual processing speed of the current order pulling cycle and the actual processing speed of the historical order pulling cycles, the expected processing speed of the next order pulling cycle is estimated; According to the estimated processing speed and the current set interval value, the estimated processing capacity of the next order pulling cycle is estimated; If the estimated processing capacity is greater than the estimated total processing volume corresponding to the next order-pulling cycle, the set interval value is expanded.
6. The CPS order processing method according to claim 1, characterized in that: The interface configuration table includes interface request information, and the order pull rule table also includes the number of single-page records, which will be written into the order pull message; the request for all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel according to the interface configuration table corresponding to the first target channel and the target order pull message includes: A paginated query method is adopted to encapsulate more than one pull request in sequence and send them to the interface corresponding to the first target channel according to the interface request information, the number of records on a single page and the time corresponding to the current pull cycle; the interface corresponding to the first target channel will feedback the corresponding first order information table for each pull request, and the number of orders contained in the first order information table is less than or equal to the number of records on a single page.
7. The CPS order processing method according to claim 6, characterized in that: The order pull rule table also includes a maximum number of pages, which will be written into the order pull message; the paging query method is adopted to sequentially encapsulate more than one pull request according to the interface request information, the number of single-page records and the time corresponding to the current order pull cycle, and send them to the interface corresponding to the first target channel, and also includes: If the number of the pull requests that have been sent is equal to the maximum number of pages, the pull request of the current pull request cycle is terminated.
8. The CPS order processing method according to claim 7, characterized in that: When the order pulling of the current order pulling cycle is ended, the method further includes: The order pulling progress of the current order pulling cycle is recorded, and a supplementary order pulling message corresponding to the first target channel is sent to the third message queue according to the order pulling progress.
9. The CPS order processing method according to claim 8, characterized in that: Also includes: In response to the target supplementary order message obtained from the third message queue, determining that the CPS channel corresponding to the target supplementary order message is a second target channel; According to the interface configuration table corresponding to the second target channel and the target order supplement message, request the interface corresponding to the second target channel for the remaining order information corresponding to the order supplement message in the order pull cycle According to the field mapping table corresponding to the second target channel, converting the received first order information table into the second order information table having the common fields; The second order information table is traversed, and the traversed order information is sent to the second message queue for order storage.
10. The CPS order processing method according to claim 7, characterized in that: When the order pulling of the current order pulling cycle is ended, the method further includes: If at the end of the current order pulling cycle, it is determined according to the order pulling rule table corresponding to the first target channel that the next order pulling cycle has not yet arrived, the maximum number of pages is increased.
11. The CPS order processing method according to claim 6, characterized in that: The order pull rule table also includes a request interval value, which will be written into the order pull message; the paging query method is adopted to encapsulate more than one pull request in sequence according to the interface request information, the number of records on a single page and the time corresponding to the current order pull cycle, and send them to the interface corresponding to the first target channel, including: A paginated query method is adopted to encapsulate more than one pull request in sequence according to the interface request information, the number of records on a single page and the time corresponding to the current pull cycle, and send them to the interface corresponding to the first target channel according to the request interval value; in the process of sending each pull request in sequence, if a current limiting prompt is received for the current pull request, the pull interval value is increased, and starting from resending the current pull request, the pull request is sent according to the updated pull interval value.
12. The CPS order processing method according to claim 1, characterized in that: The field mapping table includes a field correspondence relationship and a type correspondence relationship, wherein the field correspondence relationship is used to reflect the one-to-one correspondence between each field in the first order information table and each field in the second order information table, and the type correspondence relationship is used to reflect the correspondence between the data type of each field in the first order information table and the data type of the corresponding field in the second order information table; The step of converting the received first order information table into a second order information table having common fields according to the field mapping table corresponding to the first target channel includes: Traversing each field of the first order information table, and determining the traversed field as the original field; Determine the target field corresponding to the original field according to the field correspondence relationship; Determine, according to the type correspondence, an original field type corresponding to the original field and a target field type corresponding to the target field; Selecting a corresponding type conversion function according to the original field type and the target field type; By using the type conversion function, each element under the original field in the first order information table is converted and then sequentially imported into the target field of the second order information table.
13. The CPS order processing method according to claim 12, characterized in that: The method of using the type conversion function to convert each element under the original field in the first order information table and sequentially importing the elements into the target field in the second order information table further includes: If type conversion error information is received, determining the real field type of the original field according to the type conversion error information; In the field correspondence, the data type of the original field is updated to the real field type.
14. The CPS order processing method according to claim 1, characterized in that: Also includes: Obtain the interface document of the interface corresponding to the CPS channel; The interface document is semantically matched according to the general field, and a field mapping table corresponding to the CPS channel is generated according to the result of the semantic matching.
15. The CPS order processing method according to claim 1, characterized in that: The traversing the second order information table and sending the traversed order information to the second message queue for order storage also includes: Determine whether commission distribution is required according to the traversed order information and the corresponding business configuration table; If yes, generating a corresponding commission message according to the corresponding business configuration table and the order message; The commission message is sent to the fourth message queue for commission storage.
16. The CPS order processing method according to claim 1, characterized in that: Also includes: In response to the target order message to be received from the second message queue, determining that the CPS channel corresponding to the target order message to be received is a third target channel; Determining whether the third target channel is in the key channel list; If so, importing the order message contained in the target order message to be stored into the dedicated data table corresponding to the third target channel; The dedicated data table and the second order information table have the same field structure; If not, importing the order message contained in the target order message to be stored into a common data table; The general data table and the second order information table have the same field structure.
17. A CPS order processing device, characterized in that: include: The first traversal module is used to traverse all the connected CPS channels. If the traversed CPS channel is currently pulling orders, the traversal continues. Otherwise, it is determined whether a new order pulling cycle has arrived according to the corresponding order pulling rule table. A pull order initiation module, configured to send a pull order message corresponding to the traversed CPS channel to the first message queue when a new pull order cycle is reached, otherwise, return to the step of traversing all the connected CPS channels and continue to execute; A first response module, configured to respond to the target order pull message obtained from the first message queue and determine that the CPS channel corresponding to the target order pull message is a first target channel; An order request module, configured to request all order information corresponding to the current order pull cycle from the interface corresponding to the first target channel according to the interface configuration table corresponding to the first target channel and the target order pull message; A field conversion module, configured to convert the received first order information table into a second order information table having common fields according to a field mapping table corresponding to the first target channel; The second traversal module is used to traverse the second order information table and send the traversed order information to the second message queue for order warehousing.
18. A computer device, characterized in that: It includes one or more processors and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the one or more processors, the steps of the CPS order processing method described in any one of claims 1-16 are executed.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the CPS order processing method as described in any one of claims 1-16.
Citation Information
Patent Citations
Automatic processing method for omni-channel order classification
CN108171562A
Inter-enterprise asynchronous message transmission method and system
CN111314476A
Seckilling activity service response method and device, equipment and medium
CN112954004A
Data processing method and device, storage medium and computer equipment
CN113626218A
Resources processing method and device
CN113742078A