Order data processing method, device, electronic device and computer readable medium
By responsive to the broadcast information of the target database, obtaining order-related data, extracting key fields and combining metadata, the lag and data timeliness of the invoice process in the prior art is solved, real-time tracking and efficient data processing are realized.
Patent Information
- Application Number
- CN202110944675.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-17
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2041-08-17
AI Technical Summary
The prior art has lag and complex calling logic when processing the invoice process, which cannot meet the real-time requirements, and the order-related data is stored in a dispersed manner, affecting the data timeliness.
By responding to the broadcast information sent by the target database, it is determined whether preset information is included, so as to obtain order-related data, extract key fields to generate target metadata, and combine the metadata to form a combined data set.
Real-time tracking of the invoice process and timely processing of data is realized, reducing memory usage and improving data processing efficiency.
Smart Images

Figure CN113627998B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to an order data processing method, device, electronic device, and computer-readable medium. Background Art
[0002] Normally, the timeliness of issuing invoices offline or online is relatively high. However, since there are many process links and systems involved in invoicing, and some systems are not controlled and processed by the seller, there may be a situation where the invoicing process is stuck due to a failure in a certain link. This requires tracking the invoicing process to promptly discover the stuck nodes and find the corresponding personnel to solve them.
[0003] In the prior art, the monitoring system usually initiates the call in real time, queries each system one by one to see if it has been executed, and then forms an execution path. However, this method has obvious lag and cannot meet the real-time requirements. In addition, each business system needs to provide a query interface, and the call logic is complicated.
[0004] In addition, the existing order-related data is usually stored in a scattered manner. Therefore, when accessing the data, it is often necessary to conduct related queries, and sometimes even to perform secondary processing on the data, which affects the timeliness of data display. Summary of the invention
[0005] The content of this disclosure is used to introduce concepts in a brief form, and these concepts will be described in detail in the specific implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution for which protection is sought, nor is it intended to limit the scope of the technical solution for which protection is sought. Some embodiments of the present disclosure propose order data processing methods, devices, electronic devices, and computer-readable media to solve one or more of the technical problems mentioned in the above background technology section.
[0006] In a first aspect, some embodiments of the present disclosure provide an order data processing method, the method comprising: in response to receiving broadcast information sent by a target database, determining whether the broadcast information contains preset information; in response to determining that the preset information is contained, obtaining order-related data indicated by the broadcast information from the target database; according to the type of the order-related data, extracting key fields from the order-related data to generate target metadata, and obtaining a target metadata set; and combining each target metadata in the target metadata set to obtain a combined data set.
[0007] In some embodiments, key fields are extracted from order-related data to generate target metadata, including: dividing the order-related data into corresponding processing channels according to the type of the order-related data, and extracting key fields of the order-related data.
[0008] In some embodiments, the key fields extracted by different processing channels all include user identification information; and each target metadata in the target metadata set is combined to obtain a combined data set, including: grouping each target metadata in the target metadata set according to the user identification information; for each target metadata in the same group, combining the target metadata belonging to the same order to generate combined data, and obtaining a combined data set.
[0009] In some embodiments, key fields are extracted from order-related data to generate target metadata, including: using the extracted key fields as metadata of the order-related data, and determining primary key information and foreign key information of the metadata based on the key fields to generate target metadata.
[0010] In some embodiments, each target metadata in the target metadata set is combined to obtain a combined data set, including: according to the primary key information and foreign key information of the target metadata in the target metadata set, each target metadata with matching information is combined to generate combined data to obtain a combined data set.
[0011] In some embodiments, based on the primary key information and foreign key information of the target metadata in the target metadata set, each target metadata with matching information is combined to generate combined data, including: for each target metadata in the target metadata set, the following combination steps are performed: determining whether the target metadata is the first preset event metadata; in response to determining that it is not the first preset event metadata, determining whether there is target combined data in the combined data set based on the foreign key information of the target metadata, wherein the foreign key information of the target combined data matches the foreign key information of the target metadata; in response to determining that it exists, adding the target metadata to the target combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the target metadata; in response to determining that it does not exist, caching the target metadata.
[0012] In some embodiments, the combining step also includes: in response to determining that it is the first preset event metadata, using the first preset event metadata as the combined data, wherein the primary key information and foreign key information of the combined data are respectively the primary key information and foreign key information of the first preset event metadata; based on the foreign key information of the combined data, determining whether there is target metadata matching the foreign key information in the cached target metadata; in response to determining that there is, adding the matching target metadata to the combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the matching target metadata.
[0013] In some embodiments, the target database records and broadcasts change information in the form of binary logs; and the preset information is used to indicate the data generation or status change of a preset event, and the type of order-related data is related to the preset event or data source represented by the order-related data.
[0014] In some embodiments, the method further includes: storing each combination data in the combination data set based on the order dimension.
[0015] In a second aspect, some embodiments of the present disclosure provide an order data processing device, which includes: a determination unit, configured to determine whether the broadcast information contains preset information in response to receiving the broadcast information sent by the target database; an acquisition unit, configured to acquire the order-related data indicated by the broadcast information from the target database in response to determining that the preset information is contained; an extraction unit, configured to extract key fields from the order-related data according to the type of the order-related data to generate target metadata and obtain a target metadata set; and a combination unit, configured to combine each target metadata in the target metadata set to obtain a combined data set.
[0016] In some embodiments, the extraction unit is further configured to: divide the order-related data into corresponding processing channels according to the type of the order-related data, and extract key fields of the order-related data.
[0017] In some embodiments, the key fields extracted by different processing channels all include user identification information; and the combination unit is further configured to: group the target metadata in the target metadata set according to the user identification information; for each target metadata in the same group, combine the target metadata belonging to the same order to generate combined data, and obtain a combined data set.
[0018] In some embodiments, the extraction unit is further configured to: use the extracted key fields as metadata of the order-related data, and determine primary key information and foreign key information of the metadata based on the key fields to generate target metadata.
[0019] In some embodiments, the combination unit is further configured to: combine the target metadata with matching information according to the primary key information and the foreign key information of the target metadata in the target metadata set to generate combined data, thereby obtaining a combined data set.
[0020] In some embodiments, the combination unit is further configured to: for each target metadata in the target metadata set, determine whether the target metadata is the first preset event metadata; in response to determining that it is not the first preset event metadata, determine whether there is target combined data in the combined data set based on the foreign key information of the target metadata, wherein the foreign key information of the target combined data matches the foreign key information of the target metadata; in response to determining that it exists, add the target metadata to the target combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the target metadata; in response to determining that it does not exist, cache the target metadata.
[0021] In some embodiments, the combination unit is further configured to: in response to determining that it is the first preset event metadata, use the first preset event metadata as the combined data, wherein the primary key information and foreign key information of the combined data are respectively the primary key information and foreign key information of the first preset event metadata; based on the foreign key information of the combined data, determine whether there is target metadata matching the foreign key information in the cached target metadata; in response to determining that it exists, add the matching target metadata to the combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the matching target metadata.
[0022] In some embodiments, the target database records and broadcasts change information in the form of binary logs; and the preset information is used to indicate the data generation or status change of a preset event, and the type of order-related data is related to the preset event or data source represented by the order-related data.
[0023] In some embodiments, the device further includes a storage unit configured to store each combination data in the combination data set based on the order dimension.
[0024] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation method in the above-mentioned first aspect.
[0025] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any one of the implementations in the first aspect above is implemented.
[0026] The above-mentioned various embodiments of the present disclosure have the following beneficial effects: when receiving the broadcast information sent by the target database, the order data processing method of some embodiments of the present disclosure can first determine whether the broadcast information contains preset information in order to filter the information. If it contains preset information, the order-related data indicated by the broadcast information can be obtained in the target database, that is, the collection of the required data is completed. Then, according to the type of order-related data, key fields can be extracted from the order-related data to generate target metadata and obtain a target metadata set. Afterwards, the target metadata in the target metadata set are combined to obtain a combined data set. That is, valid data information is extracted, which can reduce memory usage and is also conducive to improving data processing efficiency, thereby ensuring the timeliness of the data. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0028] Figure 1 is an architectural diagram of an exemplary system in which some embodiments of the present disclosure may be applied;
[0029] Figure 2 is a flow chart of some embodiments of the order data processing method according to the present disclosure;
[0030] Figure 3 is a flow chart of some embodiments of the combined steps according to the present disclosure;
[0031] Figure 4 is a schematic diagram of an application scenario of the order data processing method according to some embodiments of the present disclosure;
[0032] Figure 5 is a schematic diagram of the structure of some embodiments of the order data processing device according to the present disclosure;
[0033] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION
[0034] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0035] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.
[0036] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0037] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0038] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0039] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0040] Figure 1 An exemplary system architecture 100 is shown to which an order data processing method or an order data processing apparatus according to some embodiments of the present disclosure may be applied.
[0041] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102, a server 103, and database servers 104, 105. The network 102 may be used to provide a medium for communication links between the terminal device 101, the server 103, and the database servers 104, 105. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0042] The user can use the terminal device 101 to interact with the server 103 and the database servers 104 and 105 through the network 102 to receive or send messages, etc. Various client applications can be installed on the terminal device 101, such as shopping applications, web browsers, and instant messaging tools.
[0043] The terminal device 101 here can be hardware or software. When the terminal device 101 is hardware, it can be various electronic devices with a display screen, including but not limited to smart phones, tablet computers, e-book readers, laptop portable computers and desktop computers, etc. When the terminal device 101 is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.
[0044] The server 103 may be a server that provides various services, for example, it may be a background server that provides support for the application installed on the terminal device 101. The background server may record the user's operation behavior on the shopping application. In addition, when receiving an order invoicing request, the order-related data may be collected and processed in real time, and the processing results (such as the obtained combined data set) may be stored for user query. The database servers 104 and 105 may be servers for storing data such as order information, bill information, and tax information.
[0045] Here, the server 103 and the database servers 104 and 105 can also be hardware or software. When the server 103 and the database servers 104 and 105 are hardware, they can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server 103 and the database servers 104 and 105 are software, they can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.
[0046] It should be noted that the order data processing method provided in the embodiment of the present disclosure can be executed by the server 103 or by the terminal device 101. Accordingly, the order data processing device can be set in the server 103 or in the terminal device 101. No specific limitation is made here.
[0047] It should be noted that, when the server 103 has the functions of the database servers 104 and 105 , the database servers 104 and 105 may not be provided in the system architecture 100 .
[0048] It should be understood that Figure 1 The number of terminal devices, networks, servers and database servers in the embodiment is only for illustration. According to actual needs, there may be any number of terminal devices, networks, servers and database servers.
[0049] Continue to refer Figure 2, shows a process 200 of some embodiments of the order data processing method according to the present disclosure. The method comprises the following steps:
[0050] Step 201: In response to receiving broadcast information sent by a target database, determining whether the broadcast information contains preset information.
[0051] In some embodiments, the execution entity of the order data processing method (for example Figure 1 The server 103 shown in the figure can receive the broadcast information sent by the target database through a wired connection or a wireless connection. The target database here can be any database that is connected to the execution subject in communication and stores relevant data, such as an order database, a billing database, and an invoice database. The broadcast information can be information used to indicate that the data in the target database has changed.
[0052] It is understandable that when an event occurs or changes in the database, any dynamics will be broadcast. Here, the broadcasting method and the receiving broadcasting method are not limited. For example, it can be implemented by actively reporting through the embedding interface or sending JMQ (a message middleware platform) broadcast reporting. For another example, the target database can use binary logs (such as binlog, which is used to record data updates or potential updates of relational database management systems) to record and broadcast change information. This method can abandon the traditional trigger or embedding data collection mechanism, decouple the hardware or code dependencies between the target database and the execution subject, and has no intrusion on other systems. It can not only ensure the timeliness of the data, but also improve the flexibility and simplicity of data collection.
[0053] When the execution subject receives the broadcast information sent by the target server, it can first determine whether the broadcast information contains preset information to filter the broadcast information. The preset information can be information used to characterize the required data and can be set according to actual needs. As an example, the state machine of the target database can be mapped through events or commands.
[0054] Table 1
[0055]
[0056] As can be seen from Table 1, the invoicing process can basically include the series of event nodes such as order placement, delivery, invoicing application, and invoicing. Each event is represented by the generation of certain data or the change of the state machine in the database table. For example, a batch order invoicing event corresponds to the creation of an application record of type blue ticket in the application form. The synchronization downstream event corresponds to the change of the application record status to "synchronized".
[0057] That is to say, in some embodiments, the above preset information can be used to indicate the data generation or state change of the preset event. The preset event here can be, for example, an event related to the invoicing process. In this way, the really wanted data can be collected from a large amount of broadcast information (such as binlog data), thereby improving the efficiency of collecting effective data.
[0058] Step 202, in response to determining that the preset information is included, obtaining order-related data indicated by the broadcast information from the target database.
[0059] In some embodiments, when it is determined in step 201 that the broadcast information contains preset information, the execution subject may obtain the order-related data indicated by the broadcast information from the target database. For example, the execution subject may obtain the corresponding data from the target database table indicated by the broadcast information.
[0060] Step 203: extract key fields from the order-related data according to the type of the order-related data to generate target metadata, thereby obtaining a target metadata set.
[0061] In some embodiments, based on the order-related data obtained in step 202, the execution entity may extract key fields from the order-related data according to the type of the order-related data to generate target metadata and obtain a target metadata set. The type of the order-related data may be related to preset information. For example, if the broadcast information contains preset information A, the type of order-related data indicated by the broadcast information may be first-category data. The method of extracting key fields is not limited here, such as extracting different key fields for different types of order-related data. As an example, each type of data may correspond to a list of key fields. In this way, the key fields of the order-related data are extracted using the key fields in the list corresponding to the type.
[0062] Optionally, the type of order-related data is related to the preset event or data source represented by the order-related data. For example, the order-related data is used to represent an order event, or the order-related data comes from the above-mentioned order table, in which case it can be determined to be order-related data. In addition, the execution entity can also divide the order-related data into corresponding processing corridors according to the type of the order-related data, and extract the key fields of the order-related data. Among them, the key fields extracted by different corridors are usually different.
[0063] As an example, you can apply the distributed data processing framework (such as Storm) technology, and use the components (such as Spout) therein to receive different types (sources) of data, divide different data channels, and thus disperse the pressure of data collection and processing. For the data of different channels, the shards (such as Bolt) are processed according to their respective processing methods to extract the required key fields. It should be noted that Spout is a component in Storm that obtains data. It is responsible for pulling data from external data sources and then distributing it to Bolt (data processing component) for data processing, and plays the role of Storm data entry.
[0064] Taking the order data shown in the first column of Table 1 as an example, first, this type of order-related data can be divided into order spouts; then, according to the order number, it is routed to multiple bolt nodes for data processing to extract the fields of interest. That is, according to the order number, it is divided into order bolt 1, order bolt 2... order bolt N. Extract the key fields of the data in each order bolt, such as order number, user identification information, order time, order completion time, status, etc. Among them, user identification information can be information used to uniquely characterize the user, such as user PIN (Personal identification number) or account name.
[0065] Similarly, the invoicing application (application batch) data, invoicing (application form) data, and invoice data can be divided into the invoicing application Spout, invoicing Spout, and invoice Spout respectively. In the invoicing application Spout, it can be further divided into multiple invoicing application Bolts according to the batch number, so as to extract keywords such as batch number, user identification information, invoicing application time, applicant information, invoice type, commodity details or categories, etc. In the invoicing Spout, it can be further divided into multiple invoicing Bolts according to the application form number, so as to extract keywords such as application form number, user identification information, blue or red ticket, invoicing synchronization time, amount, etc. In the invoice Spout, it can be divided into multiple invoice Bolts according to the invoice number, so as to extract keywords such as invoice number, user identification information, invoice issuance time, electronic link address, etc.
[0066] Here, the execution subject can generate the target metadata of the order-related data based on the extracted key fields, thereby obtaining a target metadata set. For example, the execution subject can store the key fields in a certain order as the target metadata and add tags. Among them, each target metadata corresponding to the same order has a matching tag. For another example, the execution subject can use the extracted key fields as the metadata of the order-related data. And based on the extracted key fields, determine the primary key information and foreign key information of the metadata to generate the target metadata. As an example, the primary key and foreign key of the order metadata are both the order number. The primary key of the invoice application metadata can be the batch number, and the foreign key is the order number. The primary key of the invoice metadata is the application number, and the foreign key is the batch number. The primary key of the invoice metadata is the invoice number, and the foreign key is the application number.
[0067] It is understandable that the above preset method can be used to split multi-layer data, thereby realizing the extraction and processing of single-dimensional data. This improves processing efficiency while also forming basic metadata for each preset event, which facilitates subsequent data splicing and combination.
[0068] Step 204: combine the target metadata in the target metadata set to obtain a combined data set.
[0069] In some embodiments, based on the target metadata set obtained in step 203, the execution subject may combine the target metadata in the set to obtain a combined data set. As an example, the execution subject may combine the target metadata corresponding to the same order, such as storing them (in order or disorderly) in the same file or folder, or establishing an association relationship, etc., to obtain the combined data.
[0070] Optionally, the key fields extracted by different processing channels may include user identification information. In this case, the execution subject may group the target metadata in the target metadata set according to the user identification information. That is, the user identification information in each target metadata in the same group matches (such as being the same). In other words, before combining, the target metadata may be aggregated according to the user identification information, so that the data of the same user can be combined and processed in the same Bolt. That is, after the target metadata is generated, it may be further divided into different data combination Bolts according to the user identification information therein, thereby avoiding the complexity of cross-slice data processing.
[0071] Furthermore, for each target metadata in the same group, the execution entity can combine the target metadata belonging to the same order to generate combined data and obtain a combined data set. As an example, the execution entity can combine the target metadata with matching information to generate combined data according to the primary key information and foreign key information of each target metadata in the target metadata set, and obtain a combined data set. That is, through the primary and foreign key associations of the target metadata, all related target metadata can be assembled and combined to form a data record of the entire process node, thereby realizing real-time tracking of the data. For specific combination steps, please refer to Figure 3 The relevant description in will not be repeated here.
[0072] It is understandable that, in order to facilitate data query and management by users, the data is usually visualized based on the order dimension. Therefore, the data format of the order dimension is also used when storing, thereby breaking the scattered storage of related data in the relational database. That is, in some embodiments, the execution entity can store each combination data in the combination data set based on the order dimension.
[0073] From the above description, we can know that the data result (combined data) generated by the above data particle splicing is the final desired data. Therefore, there is no need to perform relational operations like relational databases, nor complex memory logic operations, and only the query performance of the data needs to be considered. The use of structured data storage can meet the demand for ready-to-use data, eliminate the complexity of data reprocessing, and improve the visualization timeliness of data.
[0074] As an example, ES (Elasticsearch) can be used for storage. ES is a search server based on Lucene (an open source full-text search engine toolkit). It provides a distributed multi-user full-text search engine based on a RESTful (an architectural approach that complies with REST principles) web interface, which can achieve real-time search, stability, reliability, speed, and easy installation and use. Among them, REST (representational state transfer) is an architectural style of web services.
[0075] The methods provided by some embodiments of the present disclosure can filter the received broadcast information through preset information. In the case where preset information is included, the order-related data indicated by the broadcast information can be obtained in the target database, that is, the collection of the required data is completed. Then, according to the type of order-related data, key fields can be extracted from the order-related data to generate target metadata and obtain a target metadata set. After that, each target metadata in the target metadata set is combined to obtain a combined data set. That is, valid data information is extracted, which can reduce memory usage and is also conducive to improving data processing efficiency, thereby ensuring the timeliness of the data and realizing real-time tracking of the data.
[0076] Please refer to Figure 3 , which shows a process 300 of some embodiments of the combination steps in the order data processing method of the present disclosure. For each target metadata in the above target metadata set, the execution subject can perform the following combination steps:
[0077] Step 301: Determine whether target metadata is first preset event metadata.
[0078] In some embodiments, when target metadata is streamed in (e.g. Figure 3 When the target metadata is the first preset event metadata (such as order metadata), the execution subject may first determine whether the target metadata is the first preset event metadata (such as order metadata). For example, the execution subject may determine whether it is the first preset event metadata by analyzing the content or primary key information of the target metadata. If it is determined to be, step 305 may be executed. If it is determined not to be, step 302 may be executed.
[0079] Step 302: In response to determining that the metadata is not the first preset event metadata, determine whether target combined data exists in the combined data set according to foreign key information of the target metadata.
[0080] In some embodiments, if the execution subject determines that the target metadata is not the first preset event metadata, the foreign key information of the target metadata can be obtained. And the foreign key information is matched with the foreign key information of each combination data in the combination data set to determine whether the target combination data exists. Among them, the foreign key information of the target combination data matches the foreign key information of the target metadata (such as the same). If it is determined to exist, step 303 can be continued. If it is determined not to exist, step 304 can be executed.
[0081] Step 303: In response to determining that the target metadata exists, add the target metadata to the target combined data to generate new combined data.
[0082] In some embodiments, when the target combined data exists in the combined data set, the execution subject may add the target metadata to the target combined data to generate new combined data. Here, the adding method is not limited, for example, the target metadata may be sequentially spliced to the back of the target combined data. Another example is to write the target metadata into the target combined data and delete the target metadata. At the same time, the foreign key information of the new combined data may be modified to the primary key information of the target metadata, and step 306 is continued.
[0083] Step 304: In response to determining that the target metadata does not exist, cache the target metadata.
[0084] In some embodiments, if the target combination data does not exist in the combination data set, the target metadata may be cached, such as cached in a local cache pool, to wait for being matched and combined.
[0085] It is understandable that, usually, the inflow of target metadata is out of order. If the target metadata cannot be actively combined and spliced in real time, it means that the data of the rear node has flowed in first. Therefore, it is temporarily stored in the cache first, and then passively combined and spliced when the target metadata of the front node flows in. This can prevent data loss and improve the efficiency of combination and splicing.
[0086] Step 305: In response to determining that the metadata is the first preset event metadata, use the first preset event metadata as the combined data.
[0087] In some embodiments, if it is determined that the incoming target metadata is the first preset event metadata, the first preset event metadata can be used as the combined data, and step 306 is continued. The primary key information and foreign key information of the combined data are respectively the primary key information and foreign key information of the first preset event metadata. For example, if the target metadata is order metadata, the primary key information and foreign key information of the combined data obtained at this time are both the order number.
[0088] Step 306: Determine, based on the foreign key information of the combined data, whether there is target metadata in the cached target metadata that matches the foreign key information.
[0089] In some embodiments, based on the foreign key information of the combined data obtained in step 303 or step 305, the execution subject can determine whether there is target metadata matching the foreign key information in the cached target metadata. If so, step 307 can be continued. For example, if the foreign key information of the combined data is an order number, it can be determined whether there is invoicing application metadata with the foreign key information of the order number in the cached target metadata.
[0090] Step 307: In response to determining that the target metadata exists, the matching target metadata is added to the combined data to generate new combined data.
[0091] In some embodiments, if there is target metadata with matching foreign key information in the cached target metadata, the execution entity can add the matching target metadata to the combined data to generate new combined data. The foreign key information of the new combined data is the primary key information of the matching target metadata. For example, if there is invoicing application metadata with the same order number as the foreign key information, the execution entity can combine the invoicing application metadata with the combined data (i.e., the order metadata) to obtain the new combined data with the primary key information and foreign key information of the order number and batch number, respectively.
[0092] It should be noted that the execution subject can cyclically execute the above combination steps until the foreign key information of the new combination data is the preset foreign key information (such as the invoice number). In other words, the target metadata matched before the combination is the second preset event metadata (such as the invoice metadata). In this case, the entire invoicing process is completed.
[0093] The order data processing method disclosed in this embodiment further improves the detailed process of the combination step, making the combination process more reasonable. By defining metadata, the orderly combination and assembly of data can be achieved. In addition, the use of a cache mechanism also ensures the timeliness of data in the localized data processing process.
[0094] Please refer to Figure 4 , which shows a schematic diagram of an application scenario of the order data processing method disclosed in the present invention. In this application scenario, a user places an order on a shopping platform. And when the order is delivered, the user submits an invoicing application. During this process, the data in the relevant database will change (create or change status) and be broadcast. The server of the shopping platform (such as Figure 1 When receiving the broadcast information, the server 103 shown in FIG. 1 can execute the order data processing method described in the above embodiments to obtain a combined data set.
[0095] At this time, the staff of the shopping platform can use the terminal device (such as Figure 1 The "Process Tracking" icon displayed on the terminal device 101) shown in the figure can be used to check the invoicing progress of the order. The content of each process node can be displayed on the terminal device: User places an order 2021-07-03 08:25:43 Order completed 2021-07-03 09:17:47 Invoicing application 2021-07-03 09:18:18 Application form created 2021-07-03 09:18:18 (invoicing) Downstream invoicing 2021-07-03 09:18:18. When the invoicing is completed, the invoicing success time will also be displayed here. And the details of the invoice will also be displayed at the corresponding position. The user places an order so that the invoicing data can be tracked in real time.
[0096] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of an order data processing device. These device embodiments are similar to Figure 2 and Figure 3 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.
[0097] like Figure 5 As shown, the order data processing device 500 of some embodiments may include: a determination unit 501, configured to determine whether the broadcast information contains preset information in response to receiving the broadcast information sent by the target database; an acquisition unit 502, configured to acquire the order-related data indicated by the broadcast information from the target database in response to determining that the preset information is contained; an extraction unit 503, configured to extract key fields from the order-related data according to the type of the order-related data to generate target metadata and obtain a target metadata set; a combination unit 504, configured to combine each target metadata in the target metadata set to obtain a combined data set.
[0098] In some embodiments, the extraction unit 503 may be further configured to: divide the order-related data into corresponding processing channels according to the type of the order-related data, and extract key fields of the order-related data.
[0099] In some embodiments, the key fields extracted by different processing channels all include user identification information; and the combination unit 504 can be further configured to: group the target metadata in the target metadata set according to the user identification information; for each target metadata in the same group, combine the target metadata belonging to the same order to generate combined data, and obtain a combined data set.
[0100] Optionally, the extraction unit 503 may be further configured to: use the extracted key fields as metadata of the order-related data, and determine primary key information and foreign key information of the metadata based on the key fields to generate target metadata.
[0101] In some application scenarios, the combination unit 504 may be further configured to: combine target metadata with matching information to generate combined data according to primary key information and foreign key information of each target metadata in the target metadata set, thereby obtaining a combined data set.
[0102] Furthermore, the combination unit 504 is further configured to: for each target metadata in the target metadata set, determine whether the target metadata is the first preset event metadata; in response to determining that it is not the first preset event metadata, determine whether there is target combined data in the combined data set based on the foreign key information of the target metadata, wherein the foreign key information of the target combined data matches the foreign key information of the target metadata; in response to determining that it exists, add the target metadata to the target combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the target metadata; in response to determining that it does not exist, cache the target metadata.
[0103] Optionally, the combination unit 504 can also be configured to: in response to determining that it is the first preset event metadata, use the first preset event metadata as the combined data, wherein the primary key information and foreign key information of the combined data are respectively the primary key information and foreign key information of the first preset event metadata; based on the foreign key information of the combined data, determine whether there is target metadata matching the foreign key information in the cached target metadata; in response to determining that it exists, add the matching target metadata to the combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the matching target metadata.
[0104] In some embodiments, the target database records and broadcasts change information in the form of binary logs; and the preset information is used to indicate the data generation or status change of a preset event, and the type of order-related data is related to the preset event or data source represented by the order-related data.
[0105] Furthermore, the device 500 also includes a storage unit ( Figure 5 ), is configured to store each combination data in the combination data set based on the order dimension.
[0106] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2 and Figure 3 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.
[0107] Reference below Figure 6 , which shows an electronic device (eg, Figure 1 A schematic diagram of the structure of the server in (a) 600. Figure 6 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0108] like Figure 6As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0109] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.
[0110] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.
[0111] It should be noted that the computer-readable medium recorded in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0112] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0113] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to receiving broadcast information sent by the target database, determines whether the broadcast information contains preset information; in response to determining that the preset information is contained, obtains the order-related data indicated by the broadcast information from the target database; according to the type of the order-related data, extracts key fields from the order-related data to generate target metadata and obtains a target metadata set; and combines each target metadata in the target metadata set to obtain a combined data set.
[0114] In addition, computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0116] The units described in some embodiments of the present disclosure may be implemented by software or hardware. The units described may also be set in a processor, for example, it may be described as: a processor includes a determination unit, an acquisition unit, an extraction unit, and a combination unit. The names of these units do not constitute a limitation on the units themselves in some cases, for example, the determination unit may also be described as "a unit for determining whether the broadcast information contains preset information".
[0117] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0118] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.
Claims
1. A method for processing order data, wherein: The method comprises: In response to receiving broadcast information sent by a target database, determining whether the broadcast information includes preset information, wherein the preset information is used to indicate data generation or state change of a preset event; In response to determining that the preset information is included, acquiring order-related data indicated by the broadcast information from the target database; According to the type of the order-related data, key fields are extracted from the order-related data to generate target metadata, thereby obtaining a target metadata set, wherein the type of the order-related data is related to a preset event or data source represented by the order-related data, and key fields extracted from different types of order-related data are not completely the same; The target metadata in the target metadata set are combined to obtain a combined data set, wherein the target metadata in the same combined data have matching key fields.
2. The order data processing method according to claim 1, wherein: The step of extracting key fields from the order-related data to generate target metadata includes: According to the type of the order-related data, the order-related data is divided into corresponding processing channels, and key fields of the order-related data are extracted.
3. The order data processing method according to claim 2, wherein: The key fields extracted by different processing channels all include user identification information; as well as The step of combining the target metadata in the target metadata set to obtain a combined data set includes: grouping each target metadata in the target metadata set according to the user identification information; For each target metadata in the same group, the target metadata belonging to the same order are combined to generate combined data, thereby obtaining a combined data set.
4. The order data processing method according to claim 1, wherein: The step of extracting key fields from the order-related data to generate target metadata includes: The extracted key fields are used as metadata of the order-related data, and primary key information and foreign key information of the metadata are determined based on the key fields to generate target metadata.
5. The order data processing method according to claim 4, wherein: The step of combining the target metadata in the target metadata set to obtain a combined data set includes: According to the primary key information and the foreign key information of the target metadata in the target metadata set, the target metadata with matching information are combined to generate combined data, thereby obtaining a combined data set.
6. The order data processing method according to claim 5, wherein: The step of combining the target metadata with matching information to generate combined data according to the primary key information and the foreign key information of the target metadata in the target metadata set includes: For each target metadata in the target metadata set, the following combining steps are performed: Determining whether the target metadata is first preset event metadata; In response to determining that it is not the first preset event metadata, determining whether target combined data exists in the combined data set according to the foreign key information of the target metadata, wherein the foreign key information of the target combined data matches the foreign key information of the target metadata; In response to determining that it exists, adding the target metadata to the target combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the target metadata; In response to determining that it does not exist, the target metadata is cached.
7. The order data processing method according to claim 6, wherein: The combining step further comprises: In response to determining that it is the first preset event metadata, taking the first preset event metadata as combined data, wherein the primary key information and the foreign key information of the combined data are the primary key information and the foreign key information of the first preset event metadata respectively; Determining, according to the foreign key information of the combined data, whether there is target metadata matching the foreign key information in the cached target metadata; In response to determining that it exists, the matching target metadata is added to the combined data to generate new combined data, wherein the foreign key information of the new combined data is the primary key information of the matching target metadata.
8. The order data processing method according to claim 1, wherein: The target database uses binary logs to record and broadcast change information.
9. The order data processing method according to any one of claims 1 to 8, wherein: The method further comprises: Based on the order dimension, each combination data in the combination data set is stored.
10. An order data processing device, wherein: The device comprises: a determining unit, configured to, in response to receiving broadcast information sent by a target database, determine whether the broadcast information contains preset information, wherein the preset information is used to indicate data generation or state change of a preset event; an acquisition unit, configured to acquire, in response to determining that the preset information is included, order-related data indicated by the broadcast information from the target database; an extraction unit, configured to extract key fields from the order-related data to generate target metadata and obtain a target metadata set according to the type of the order-related data, wherein the type of the order-related data is related to a preset event or data source represented by the order-related data, and the key fields extracted from different types of order-related data are not completely the same; The combining unit is configured to combine each target metadata in the target metadata set to obtain a combined data set, wherein each target metadata in the same combined data has a matching key field.
11. An electronic device, comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 9.
12. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Patent Citations
Method and system of encapsulating electronic invoices
CN104820941A
Method and device for data processing, electronic device and storage medium
CN108932313A