A method and apparatus for processing broadcast service packets
Patent Information
- Application Number
- CN202211374880.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-04
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-11-04
AI Technical Summary
在跨境支付系统对业务报文进行处理时,将会导致业务处理异常
[0047]本发明实施例中,预先根据每个业务类型的之前结算周期的历史业务报文进行分析,构建每个业务类型的主键查重模型,在接收到业务报文时,根据业务报文的业务类型确定对应的主键查重模型,然后利用确定的主键查重模型对接收到的业务报文进行查重,若业务报文的查重结果为未重复,则将业务报文存储到处理队列中进行处理,并根据业务报文的主键更新主键查重模型,以便于利用更新后的主键查重模型对后续该业务类型的业务报文进行查重。相比于现有技术将处理过的业务报文存储在数据库中,当接收到业务报文时从数据库中进行查找,确定是否找到相同的业务报文,从而确定接收到的业务报文是否重复的方法,实现了利用内存中存储的主键查重模型对接收到的业务报文进行查重,提高了查重的速度,并在不重复的情况下利用该业务报文更新主键查重模型,实现了利用不重复的业务报文的主键逐步优化该主键查重模型,从而提高主键查重模型的适应范围以及准确度。此外,本发明利用当前业务结算周期之前的历史业务报文构建主键查重模型,然后再利用当前结算周期内接收到的、并判断为不重复的业务报文对主键查重模型进行更新,可以理解为,根据历史业务报文构建的主键查重模型能够引导主键查重模型的更新,从而提高主键查重模型的查重效果。
Smart Images

Figure CN115760387B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of financial technology, and in particular to a method and apparatus for processing broadcast-type business messages. Background Technology
[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] In the field of cross-border payments, broadcast messages do not have a specific, single recipient. All direct participants in an online cross-border payment system may receive broadcast messages with identical format, information, and identifiers. However, for a single cross-border payment system with multiple overseas direct participating banks, it may receive multiple messages with completely identical characteristics and content. For example, there may be numerous direct participating banks (A, B, C, etc.) all operating under the same cross-border payment system. In such cases, broadcast messages are issued according to the number of direct participating banks, resulting in the cross-border payment system receiving multiple identical broadcast messages addressed to all direct participating banks. This will lead to processing anomalies when the cross-border payment system processes these messages.
[0004] There is an urgent need for a method to process broadcast business messages, in order to solve the problem in existing technologies where cross-border payment systems repeatedly process business messages with identical feature data and information content, which affects the business process and causes abnormal business processing status. Summary of the Invention
[0005] To address the problems existing in the prior art, embodiments of the present invention provide a method and apparatus for processing broadcast business messages. This method determines whether the primary key of a business message has already been recorded upon receipt, and discards the business message if the primary key has been recorded. This solves the problem in the prior art where cross-border payment systems repeatedly process business messages with identical feature data and information content, causing disruptions to the business process and abnormal business processing status.
[0006] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:
[0007] This invention provides a method for processing broadcast service messages, the method comprising:
[0008] Upon receiving a business message, the business message is deduplicated based on its primary key and the primary key deduplication model corresponding to its business type. The primary key deduplication model is constructed by analyzing the primary keys of multiple historical messages corresponding to the business type. These multiple historical business messages are business messages that have been processed before the current business settlement cycle.
[0009] If the result of the deduplication check is no duplicate, the business message is stored in the processing queue for processing, and the primary key deduplication model is updated according to the primary key of the business message.
[0010] Furthermore, the primary key deduplication model has a tree-like data structure, and the primary key includes the field values of multiple fields;
[0011] Constructing the primary key deduplication model corresponding to the aforementioned business type further includes,
[0012] Calculate the number of times the same field value appears in each field of the primary key in multiple historical business messages;
[0013] Based on the frequency of occurrence, the field value is selected from the predetermined fields to construct the tree data structure of the primary key deduplication model.
[0014] Furthermore, the process of selecting field values from predetermined fields based on the frequency of occurrence, and constructing the tree-like data structure of the primary key deduplication model, further includes:
[0015] If the proportion of duplicate messages in the historical business messages exceeds a predetermined threshold, the field value that appears the least is selected to construct the tree data structure of the primary key deduplication model;
[0016] If the proportion of duplicate messages in the historical business messages does not exceed the predetermined threshold, the field value that appears most frequently is selected to construct the tree data structure of the primary key deduplication model.
[0017] Furthermore, the process of selecting field values from predetermined fields based on the frequency of occurrence, and constructing the tree-like data structure of the primary key deduplication model, further includes:
[0018] The business type is used as the root node data of the tree data structure;
[0019] Based on the occurrence frequency and the field value of the predetermined field, the root node is constructed into multiple layers of child nodes. The fields corresponding to child nodes at the same level are the same, and the data of the child node is the field value corresponding to the field. The upper-level child node is the parent node of the lower-level child node.
[0020] Furthermore, if the proportion of duplicate messages in the historical service messages exceeds a predetermined threshold, constructing a multi-level child node of the root node based on the occurrence count and the field value of a predetermined field further includes...
[0021] According to the order of occurrence from low to high, the field value of each predetermined field is used as the data of the child node in the corresponding level of the sorting. The child node corresponding to the occurrence count at the beginning of the sorting is the parent node of the child node corresponding to the occurrence count at the end of the sorting.
[0022] Furthermore, if the proportion of duplicate messages in the historical service messages does not exceed the predetermined threshold, constructing a multi-level child node of the root node based on the occurrence count and the field value of a predetermined field further includes...
[0023] According to the order of occurrence from high to low, the field value of each predetermined field is used as the data of the child node in the corresponding level of the sorting. The child node corresponding to the occurrence count at the beginning of the sorting is the parent node of the child node corresponding to the occurrence count at the end of the sorting.
[0024] Furthermore, the deduplication process for the business message based on its primary key and the primary key deduplication model corresponding to its business type further includes:
[0025] Based on the business type of the business message and the data of the root node of the tree data structure, determine the primary key deduplication model corresponding to the business type of the business message;
[0026] Extract the values of multiple fields from the primary key of the business message;
[0027] The field values of the multiple fields are compared with the data of each child node in the tree data structure;
[0028] If the field value of each field can be found in the tree data structure with the same child node, and the found child node corresponds to the same first-level parent node, then the deduplication result of the business message is duplicate.
[0029] Furthermore, comparing the field values of the multiple fields with the data of each child node in the tree data structure further includes,
[0030] According to the hierarchy of each child node in the tree data structure, extract the data of the child nodes of each level from top to bottom;
[0031] Starting from the first-level child nodes, compare the data of the first-level child nodes with the field values of the corresponding fields of the first-level child nodes to see if they are the same.
[0032] If they are different, the comparison of the node values of the next-level child nodes is stopped, and the deduplication result of the service message is that it is not repeated.
[0033] If they are the same, then continue to compare whether the data of the next-level child node is the same as the field value corresponding to the next-level child node.
[0034] Furthermore, updating the primary key deduplication model based on the primary key of the business message further includes,
[0035] For field values that differ from the data of child nodes, the child node corresponding to the previous child node with the same field value is taken as the parent node, and a child node is created for that parent node. The field value is then used as the data for the newly created child node.
[0036] Furthermore, comparing the field values of the multiple fields with the data of each child node in the tree data structure further includes,
[0037] If the field does not have a corresponding child node in the tree data structure, the deduplication result of the business message is "not duplicated".
[0038] Furthermore, if the field does not have a corresponding child node in the tree data structure, updating the primary key deduplication model based on the primary key of the business message also includes:
[0039] The child node corresponding to the previous field value is taken as the parent node, and the child node of the parent node is created. The field value corresponding to the field is used as the data of the created child node, and the layer of the created child node corresponds to the field.
[0040] Furthermore, if the deduplication result is a duplicate, the service message will be discarded.
[0041] This invention also provides a processing apparatus for broadcast service messages, the apparatus comprising:
[0042] The message deduplication unit is used to perform deduplication on the business message when it is received, based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message. The primary key deduplication model is constructed by analyzing the primary keys of multiple historical messages corresponding to the business type. The multiple historical business messages are business messages that have been processed before the current business settlement cycle.
[0043] The message processing unit is used to store the business message in a processing queue for processing if the result of the deduplication check is that it is not duplicated, and to update the primary key deduplication model according to the primary key of the business message.
[0044] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described method.
[0045] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0046] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method.
[0047] In this embodiment of the invention, historical business messages from previous settlement cycles for each business type are analyzed in advance to construct a primary key deduplication model for each business type. Upon receiving a business message, the corresponding primary key deduplication model is determined based on the business type of the message. Then, the received business message is deduplicated using the determined primary key deduplication model. If the deduplication result of the business message is not duplicated, the business message is stored in a processing queue for processing, and the primary key deduplication model is updated based on the primary key of the business message. This allows for the use of the updated primary key deduplication model to deduplicatize subsequent business messages of the same business type. Compared to existing technologies that store processed business messages in a database and search the database upon receiving a new business message to determine if a duplicate is found, this invention utilizes a primary key deduplication model stored in memory to deduplicat the received business messages, improving the deduplication speed. Furthermore, by updating the primary key deduplication model using the business message when no duplicates are found, the primary key deduplication model is progressively optimized using the primary keys of unique business messages, thereby improving the applicability and accuracy of the primary key deduplication model. Furthermore, this invention utilizes historical business messages prior to the current business settlement cycle to construct a primary key deduplication model, and then uses business messages received within the current settlement cycle that are determined to be non-duplicate to update the primary key deduplication model. It can be understood that the primary key deduplication model constructed based on historical business messages can guide the update of the primary key deduplication model, thereby improving the deduplication effect of the primary key deduplication model. Attached Figure Description
[0048] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0049] Figure 1 This is a schematic diagram of an implementation system for a method of processing broadcast service messages according to an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram illustrating the steps of a method for processing broadcast service messages in an embodiment of the present invention;
[0051] Figure 3This refers to the steps in this embodiment of the invention for constructing a primary key deduplication model corresponding to a business type;
[0052] Figure 4 This is a step in the embodiment of the present invention to select the field value from a predetermined field according to the frequency of occurrence, and construct a tree-shaped data structure for the primary key deduplication model;
[0053] Figure 5 This is a step in the embodiment of the present invention to perform deduplication on a business message based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message;
[0054] Figure 6 This is a schematic diagram of the structure of a device for processing broadcast service messages according to an embodiment of the present invention;
[0055] Figure 7 This is a schematic diagram of the computer device structure provided in an embodiment of the present invention.
[0056] Explanation of symbols in the attached drawings:
[0057] 101. Terminal cluster;
[0058] 102. Business Message Processing System;
[0059] 601. Message Deduplication Unit;
[0060] 602. Message Processing Unit;
[0061] 702. Computer equipment;
[0062] 704. Processing equipment;
[0063] 706. Storage resources;
[0064] 708. Drive mechanism;
[0065] 710. Input / Output Module;
[0066] 712. Input devices;
[0067] 714. Output devices;
[0068] 716. Presentation equipment;
[0069] 718. Graphical User Interface;
[0070] 720. Network interface;
[0071] 722. Communication link;
[0072] 724. Communication bus. Detailed Implementation
[0073] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0074] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0075] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, apparatus, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices.
[0076] like Figure 1 The diagram illustrates an implementation system for a broadcast service message processing method according to an embodiment of this paper. It may include a terminal cluster 101 and a service message processing system 102. The terminal cluster 101 includes multiple terminals. Each terminal sends a service message, which is transmitted to the service message processing system 102 via a network. The service message processing system 102 processes the service message. The network may include a Local Area Network (LAN), a Wide Area Network (WAN), the Internet, or a combination thereof, and is connected to a website, user equipment (e.g., computing devices), and a backend system. Optionally, the service message processing system 102 may include multiple nodes (not shown in the diagram), or each node may be a separate cloud computing system, including multiple computers interconnected by a network and operating as a distributed processing system.
[0077] In addition, it should be noted that, Figure 1 The example shown is merely one application environment provided by this disclosure. In practical applications, other application environments may also be included, and this specification does not impose any limitations.
[0078] In existing technologies, when determining whether a business message has been processed repeatedly, the business message processing system 102 typically compares a new business message with the processed business messages already stored in the database. If they are the same, it indicates that the currently received business message has already been processed. However, when performing duplicate checks on received business messages, it is necessary to construct a database query statement based on the extracted content of the business message and then use the database query statement for duplicate checking. But querying the database takes longer than querying from memory. Therefore, if some information of the already processed business messages can be stored in memory, and a new business message can be retrieved from memory, the duplicate checking speed can be improved to a certain extent. Especially when a large number of business messages are received, abandoning the method of storing the processed business messages in the database can also reduce the system's storage space utilization to a certain extent.
[0079] To address the problems existing in the prior art, this embodiment of the invention provides a method for processing broadcast service messages, which can be applied in the service message processing system 102 to judge service messages and avoid multiple service processing nodes processing the same service message. Figure 2 This is a schematic diagram illustrating the steps of a service message processing method provided in an embodiment of the present invention. This specification provides the method operation steps described in the embodiments or flowcharts, but based on conventional or non-inventive methods, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only execution order. In actual system or device products, the methods shown in the embodiments or drawings can be executed sequentially or in parallel. Specifically, as shown in the attached drawings... Figure 2 As shown, the method may include:
[0080] Step 201: Upon receiving a business message, perform a deduplication check on the business message based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message.
[0081] In this step, the primary key deduplication model is constructed by analyzing the primary keys of multiple historical messages corresponding to the business type. These multiple historical business messages are business messages that have been processed before the current business settlement cycle.
[0082] Step 202: If the result of the deduplication check is no duplicate, the business message is stored in the processing queue for processing, and the primary key deduplication model is updated according to the primary key of the business message.
[0083] The method of this invention pre-analyzes historical business messages from previous settlement cycles for each business type to construct a primary key deduplication model for each business type. Upon receiving a business message, the corresponding primary key deduplication model is determined based on the business type of the message. The received business message is then deduplicated using this determined model. If the deduplication result is no duplicate, the message is stored in a processing queue for further processing. The primary key deduplication model is updated based on the primary key of the message, allowing for the use of the updated model to deduplicate subsequent business messages of the same business type. Compared to existing technologies that store processed business messages in a database and search the database upon receiving a new message to determine if a duplicate message is found, this method utilizes a memory-stored primary key deduplication model to deduplicate received business messages, improving deduplication speed. Furthermore, by updating the primary key deduplication model using the unique primary keys of the business messages, the model is progressively optimized, improving its applicability and accuracy. Furthermore, this invention utilizes historical business messages prior to the current business settlement cycle to construct a primary key deduplication model, and then uses business messages received within the current settlement cycle that are determined to be non-duplicate to update the primary key deduplication model. It can be understood that the primary key deduplication model constructed based on historical business messages can guide the update of the primary key deduplication model, thereby improving the deduplication effect of the primary key deduplication model.
[0084] According to one embodiment of the present invention, if the result of the deduplication check is that the message is duplicated, the message is discarded.
[0085] According to an embodiment of the present invention, in order to improve the speed of plagiarism detection and reduce memory usage, the primary key plagiarism detection model of the present invention is a tree data structure, wherein the primary key includes field values of multiple fields;
[0086] like Figure 3 As shown, constructing the primary key deduplication model corresponding to the business type further includes,
[0087] Step 301: Calculate the number of times the same field value appears in each field of the primary key in multiple historical business messages;
[0088] Step 302: Select the field value from the predetermined fields according to the occurrence frequency to construct the tree data structure of the primary key deduplication model.
[0089] In this embodiment of the invention, the primary key deduplication model constructed based on historical business messages can be considered as the basis for updating the primary key deduplication model and is used to guide the updating of the primary key deduplication model. Therefore, the initial field value to guide the updating of the primary key deduplication model can be selected based on the occurrence of the same field value of each field of the primary key in the historical business messages. By matching the initial field value, it is possible to determine whether the business messages are duplicated more quickly.
[0090] However, since historical business messages were received in previous business settlement cycles, business messages received in the current business settlement cycle may be identical to a historical business message received in a previous business settlement cycle. This does not necessarily indicate that the business message is duplicated. Therefore, when constructing the primary key deduplication model, only the field values of a subset of the primary key need to be selected. The primary key deduplication model is constructed based on these field values. This constructed model can be considered a part of a tree-like data structure, including only nodes at a specified level, with the field values of predetermined fields used as the node values of the corresponding nodes. When performing deduplication on received business messages, it is necessary to compare the field values of multiple fields corresponding to the primary key of the received business message with the node values of the corresponding nodes in the primary key deduplication model to determine if the business message is duplicated.
[0091] In this embodiment of the invention, if it is known from the processing of historical service messages that there are many duplicate service messages, then during deduplication, the deduplication can be performed first to check whether the field values that appear less frequently are duplicated. This can determine whether the service messages are duplicated more quickly. If there are few duplicate service messages, matching the field values that appear less frequently will actually increase the number of matches. Therefore, according to one embodiment of the invention, as... Figure 4 As shown, the tree data structure for constructing the primary key deduplication model further includes selecting the field value from a predetermined field based on the frequency of occurrence, and constructing the tree data structure of the primary key deduplication model.
[0092] Step 401: If the proportion of duplicate messages in the historical business messages exceeds a predetermined threshold, select the field value that appears the least and construct the tree data structure of the primary key deduplication model;
[0093] Step 402: If the proportion of duplicate messages in the historical business messages does not exceed the predetermined threshold, select the field value that appears most frequently and construct the tree data structure of the primary key deduplication model.
[0094] This can be understood as follows: if duplicate business messages appear frequently, it means that the field values in the duplicate messages also appear frequently. However, the number of normal business messages is much greater than the number of duplicate business messages. Therefore, in this embodiment of the invention, the field values that appear the least frequently are selected. In other words, the selected field values of the predetermined fields all appear the least frequently. A tree-like data structure for the primary key deduplication model is constructed based on the field values that appear the least frequently in the predetermined fields. When performing deduplication, these field values that appear the least frequently can be matched first. If the field value that appears the least frequently is not matched successfully, it means that the business message is not duplicated.
[0095] Conversely, if duplicate business messages appear less frequently, it means that the field values in the duplicate messages also appear less frequently. Since duplicate messages themselves appear less frequently, if the number of matching field values also appears less frequently, it will be difficult to find a match, increasing the number of matches. Therefore, when duplicate messages appear less frequently, the field values that appear most frequently are selected. In other words, the selected fields are all the most frequently occurring fields. A tree-like data structure for the primary key deduplication model is built based on the most frequently occurring field values. During deduplication, these most frequently occurring field values are matched first, and then matched layer by layer. If no field value matches successfully, it means that the business message is not duplicated.
[0096] In this embodiment of the invention, the predetermined threshold value can be set by human experience, etc., and this embodiment of the invention does not impose any restrictions.
[0097] According to one embodiment of the present invention, the parent-child node relationship between field values can be determined based on the frequency of occurrence of the selected field value in each field. This means determining which level of the tree data structure the field corresponds to, and the data of all nodes in that level belong to the field value of that field. Specifically, selecting the field value from predetermined fields based on the frequency of occurrence, and constructing the tree data structure of the primary key deduplication model, further includes...
[0098] The business type is used as the root node data of the tree data structure;
[0099] Based on the occurrence frequency and the field value of the predetermined field, the root node is constructed into multiple layers of child nodes. The fields corresponding to child nodes at the same level are the same, and the data of the child node is the field value corresponding to the field. The upper-level child node is the parent node of the lower-level child node.
[0100] In this embodiment of the invention, the root node of the tree-like data structure corresponds to the business type. This allows for faster determination of which primary key deduplication model corresponds to the business type of a business message during deduplication. Then, multi-level child nodes are constructed under the root node based on the frequency of occurrence and the values of predetermined fields. Child nodes at the same level correspond to the same fields, and the data of the child nodes is the field value corresponding to the field. The parent node of the next level is the parent node of the child node of the next level. This can be understood as the association between parent and child nodes being determined by the frequency of occurrence of the selected field value. Field values that originally had no logical relationship are associated based on this frequency of occurrence. This association represents the matching order of fields in the business message during deduplication. The order of matching fields based on the proportion of duplicate messages in the historical processing of business messages determines whether to match fields with higher or lower frequency occurrences first, thereby improving deduplication efficiency.
[0101] Specifically, according to one embodiment of the present invention, if the proportion of duplicate packets in the historical service packets exceeds a predetermined threshold, constructing a multi-level child node of the root node based on the occurrence count and the field value of a predetermined field further includes...
[0102] According to the order of occurrence from low to high, the field value of each predetermined field is used as the data of the child node in the corresponding level of the sorting. The child node corresponding to the occurrence count at the beginning of the sorting is the parent node of the child node corresponding to the occurrence count at the end of the sorting.
[0103] If the proportion of duplicate messages in the historical service messages does not exceed the predetermined threshold, constructing a multi-level child node of the root node based on the occurrence count and the field value of a predetermined field further includes...
[0104] According to the order of occurrence from high to low, the field value of each predetermined field is used as the data of the child node in the corresponding level of the sorting. The child node corresponding to the occurrence count at the beginning of the sorting is the parent node of the child node corresponding to the occurrence count at the end of the sorting.
[0105] According to one embodiment of the present invention, such as Figure 5 As shown, the deduplication process for the business message based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message further includes:
[0106] Step 501: Based on the business type of the business message and the data of the root node of the tree data structure, determine the primary key deduplication model corresponding to the business type of the business message;
[0107] Step 502: Extract the field values of multiple fields from the primary key of the business message;
[0108] Step 503: Compare the field values of the multiple fields with the data of each child node in the tree data structure;
[0109] Step 504: If the field value of each field can be found in the tree data structure with the same child node, and the found child node corresponds to the same first-level parent node, then the deduplication result of the business message is duplicate.
[0110] In this embodiment of the invention, a business message is considered unique only if none of the field values in the primary key are recorded as a single business message. This embodiment determines the association between field values of two nodes through the parent-child relationship between child and parent nodes. In other words, if all fields of a business message to be deduplicated have corresponding matches in the primary key deduplication model, and these matching field values do not belong to the same first-level parent node, then the business message is unique. If these field values matched in the initial primary key deduplication model belong to the same first-level parent node, then they are necessarily recorded as the same message in the tree data structure.
[0111] Specifically, comparing the field values of the multiple fields with the data of each child node in the tree data structure further includes,
[0112] According to the hierarchy of each child node in the tree data structure, extract the data of the child nodes of each level from top to bottom;
[0113] Starting from the first-level child nodes, compare the data of the first-level child nodes with the field values of the corresponding fields of the first-level child nodes to see if they are the same.
[0114] If they are different, the comparison of the node values of the next-level child nodes is stopped, and the deduplication result of the service message is that it is not repeated.
[0115] If they are the same, then continue to compare whether the data of the next-level child node is the same as the field value corresponding to the next-level child node.
[0116] This can be understood as follows: if the data of the parent node differs from the field value of the corresponding field in the current child node, it directly indicates that the business message has not been recorded in the tree data structure. Conversely, if the data of the parent node matches the field value of the corresponding child node, the comparison continues downwards until the last child node of the parent node in the tree data structure is found. The data of the last child node is then compared to the field value. If they match, it indicates that the business message has already been processed.
[0117] According to one embodiment of the present invention, if there are no duplicate business messages, the primary key deduplication model needs to be updated based on the business message. This means writing the field value of the primary key corresponding to the business message into the tree data structure of the primary key deduplication model. Specifically, updating the primary key deduplication model based on the primary key of the business message further includes…
[0118] For field values that differ from the data of child nodes, the child node corresponding to the previous child node with the same field value is taken as the parent node, and a child node is created for that parent node. The field value is then used as the data for the newly created child node.
[0119] In this embodiment of the invention, the fields corresponding to different data values are first determined, then the child node level corresponding to this field is determined, and then the node corresponding to the same field value as the previous child node is found in the parent node of this child node. A child node is created under this parent node, and then the field value is used as the data of the created child node. Thus, the primary key record of the unique business message is recorded in the primary key deduplication model.
[0120] In this embodiment of the invention, the fields used to construct the primary key deduplication model are predetermined and do not include all the fields of the primary key. Therefore, during the deduplication process, there may be a field that does not have a corresponding layer in the tree data structure, meaning that the field value was not selected when constructing the primary key deduplication model. To address this situation, according to one embodiment of the invention, comparing the field values of the plurality of fields with the data of each child node in the tree data structure further includes...
[0121] If the field does not have a corresponding child node in the tree data structure, the deduplication result of the business message is "not duplicated".
[0122] This can be understood as follows: if a field in a business message does not have a corresponding child node in the tree data structure, it means that the primary key of the business message has not yet been recorded in the primary key deduplication model (that is, the first business message deduplicated by the primary key deduplication model), and the deduplication result of the business message is that it is not duplicated.
[0123] Furthermore, if the field does not have a corresponding child node in the tree data structure, updating the primary key deduplication model based on the primary key of the business message also includes:
[0124] The child node corresponding to the previous field value is taken as the parent node, and the child node of the parent node is created. The field value corresponding to the field is used as the data of the created child node, and the layer of the created child node corresponds to the field.
[0125] In this embodiment of the invention, if a field does not have a corresponding child node, the child node corresponding to the previous field value is first found as the parent node, and then the child node of the parent node is created. The field value corresponding to the field is used as the data of the created child node, thereby recording the primary key of this business message in the primary key deduplication model.
[0126] Based on the same inventive concept, embodiments of this specification also provide a processing apparatus for broadcast service messages, such as... Figure 6 As shown, the device includes:
[0127] The message deduplication unit 601 is used to perform deduplication on the business message when it receives the business message, based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message. The primary key deduplication model is constructed by analyzing the primary keys of multiple historical messages corresponding to the business type. The multiple historical business messages are business messages that have been processed before the current business settlement cycle.
[0128] The message processing unit 602 is used to store the business message in a processing queue for processing if the result of the deduplication check is that it is not duplicated, and to update the primary key deduplication model according to the primary key of the business message.
[0129] The beneficial effects obtained by the above-described device are the same as those obtained by the above-described method, and will not be described in detail in the embodiments of this specification.
[0130] like Figure 7 The diagram illustrates the structure of a computer device according to an embodiment of the present invention. The apparatus in this invention can be the computer device described in this embodiment, executing the method of the present invention as described above. The computer device 702 may include one or more processing devices 704, such as one or more central processing units (CPUs), each of which can implement one or more hardware threads. The computer device 702 may also include any storage resource 706 for storing information of any kind, such as code, settings, data, etc. Non-limitingly, for example, the storage resource 706 may include any type of RAM, any type of ROM, flash memory, hard disk, optical disk, etc. More generally, any storage resource can use any technology to store information. Further, any storage resource can provide volatile or non-volatile retention of information. Further, any storage resource can represent a fixed or removable component of the computer device 702. In one case, when the processing device 704 executes associated instructions stored in any storage resource or combination of storage resources, the computer device 702 can perform any operation of the associated instructions. The computer device 702 also includes one or more drive mechanisms 708 for interacting with any storage resource, such as a hard disk drive mechanism, an optical disk drive mechanism, etc.
[0131] Computer device 702 may also include an input / output module 710 (I / O) for receiving various inputs (via input device 712) and providing various outputs (via output device 714). A specific output mechanism may include a presentation device 716 and an associated graphical user interface (GUI) 718. In other embodiments, the input / output module 710 (I / O), input device 712, and output device 714 may be omitted, and the device may function solely as a computer device within a network. Computer device 702 may also include one or more network interfaces 720 for exchanging data with other devices via one or more communication links 722. One or more communication buses 724 couple the components described above together.
[0132] Communication link 722 can be implemented in any way, such as via a local area network, a wide area network (e.g., the Internet), a point-to-point connection, or any combination thereof. Communication link 722 may include any combination of hardwired links, wireless links, routers, gateway functions, name servers, etc., governed by any protocol or combination of protocols.
[0133] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0134] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method.
[0135] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0136] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0139] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for processing broadcast service messages, characterized in that, The method includes: Upon receiving a business message, the business message is deduplicated based on its primary key and the primary key deduplication model corresponding to its business type. The primary key deduplication model is constructed by analyzing the primary keys of multiple historical messages corresponding to the business type. These multiple historical business messages are business messages that have been processed before the current business settlement cycle. If the result of the deduplication check is no duplicate, the business message is stored in the processing queue for processing, and the primary key deduplication model is updated according to the primary key of the business message. The primary key deduplication model has a tree-like data structure, and the primary key includes the values of multiple fields. Constructing the primary key deduplication model corresponding to the aforementioned business type further includes, Calculate the number of times the same field value appears in each field of the primary key in multiple historical business messages; Based on the frequency of occurrence, the field value is selected from the predetermined fields to construct the tree data structure of the primary key deduplication model; The process of constructing the tree-like data structure of the primary key deduplication model further includes selecting the field value from a predetermined field based on the frequency of occurrence, and then... If the proportion of duplicate messages in the historical business messages exceeds a predetermined threshold, the field value that appears the least is selected to construct the tree data structure of the primary key deduplication model; If the proportion of duplicate messages in the historical business messages does not exceed the predetermined threshold, the field value that appears most frequently is selected to construct the tree data structure of the primary key deduplication model; The process of constructing the tree-like data structure of the primary key deduplication model further includes selecting the field value from a predetermined field based on the frequency of occurrence, and then... The business type is used as the root node data of the tree data structure; Based on the occurrence frequency and the field value of the predetermined field, the root node is constructed into multiple layers of child nodes. The fields corresponding to child nodes at the same level are the same, and the data of the child node is the field value corresponding to the field. The upper-level child node is the parent node of the lower-level child node.
2. The method according to claim 1, characterized in that, If the proportion of duplicate messages in the historical service messages exceeds a predetermined threshold, constructing a multi-level child node of the root node based on the occurrence count and the field value of a predetermined field further includes... According to the order of occurrence from low to high, the field value of each predetermined field is used as the data of the child node in the corresponding level of the sorting. The child node corresponding to the occurrence count at the beginning of the sorting is the parent node of the child node corresponding to the occurrence count at the end of the sorting.
3. The method according to claim 1, characterized in that, If the proportion of duplicate messages in the historical service messages does not exceed the predetermined threshold, constructing a multi-level child node of the root node based on the occurrence count and the field value of a predetermined field further includes... According to the order of occurrence from high to low, the field value of each predetermined field is used as the data of the child node in the corresponding level of the sorting. The child node corresponding to the occurrence count at the beginning of the sorting is the parent node of the child node corresponding to the occurrence count at the end of the sorting.
4. The method according to claim 2 or 3, characterized in that, The deduplication process for the business message, based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message, further includes: Based on the business type of the business message and the data of the root node of the tree data structure, determine the primary key deduplication model corresponding to the business type of the business message; Extract the values of multiple fields from the primary key of the business message; The field values of the multiple fields are compared with the data of each child node in the tree data structure; If the field value of each field can be found in the tree data structure with the same child node, and the found child node corresponds to the same first-level parent node, then the deduplication result of the business message is duplicate.
5. The method according to claim 4, characterized in that, Comparing the field values of the multiple fields with the data of each child node in the tree data structure further includes, According to the hierarchy of each child node in the tree data structure, extract the data of the child nodes of each level from top to bottom; Starting from the first-level child nodes, compare the data of the first-level child nodes with the field values of the corresponding fields of the first-level child nodes to see if they are the same. If they are different, the comparison of the node values of the next-level child nodes is stopped, and the deduplication result of the service message is that it is not repeated. If they are the same, then continue to compare whether the data of the next-level child node is the same as the field value corresponding to the next-level child node.
6. The method according to claim 5, characterized in that, Updating the primary key deduplication model based on the primary key of the business message further includes... For field values that differ from the data of child nodes, the child node corresponding to the previous child node with the same field value is taken as the parent node, and a child node is created for that parent node. The field value is then used as the data for the newly created child node.
7. The method according to claim 5, characterized in that, Comparing the field values of the multiple fields with the data of each child node in the tree data structure further includes, If the field does not have a corresponding child node in the tree data structure, the deduplication result of the business message is "not duplicated".
8. The method according to claim 7, characterized in that, If the field does not have a corresponding child node in the tree data structure, updating the primary key deduplication model based on the primary key of the business message further includes... The child node corresponding to the previous field value is taken as the parent node, and the child node of the parent node is created. The field value corresponding to the field is used as the data of the created child node, and the layer of the created child node corresponds to the field.
9. The method according to claim 1, characterized in that, If the deduplication result is duplicated, the service message will be discarded.
10. A processing apparatus for broadcast service messages, characterized in that, include: The message deduplication unit is used to perform deduplication on the business message when it is received, based on the primary key of the business message and the primary key deduplication model corresponding to the business type of the business message. The primary key deduplication model is constructed by analyzing the primary keys of multiple historical messages corresponding to the business type. The multiple historical business messages are business messages that have been processed before the current business settlement cycle. The message processing unit is configured to, if the result of the deduplication check is that the message is not duplicated, store the message in the processing queue for processing, and update the primary key deduplication model according to the primary key of the message. The primary key deduplication model has a tree-like data structure, and the primary key includes the values of multiple fields. Constructing the primary key deduplication model corresponding to the aforementioned business type further includes, Calculate the number of times the same field value appears in each field of the primary key in multiple historical business messages; Based on the frequency of occurrence, the field value is selected from the predetermined fields to construct the tree data structure of the primary key deduplication model; The process of constructing the tree-like data structure of the primary key deduplication model further includes selecting the field value from a predetermined field based on the frequency of occurrence, and then... If the proportion of duplicate messages in the historical business messages exceeds a predetermined threshold, the field value that appears the least is selected to construct the tree data structure of the primary key deduplication model; If the proportion of duplicate messages in the historical business messages does not exceed the predetermined threshold, the field value that appears most frequently is selected to construct the tree data structure of the primary key deduplication model; The process of constructing the tree-like data structure of the primary key deduplication model further includes selecting the field value from a predetermined field based on the frequency of occurrence, and then... The business type is used as the root node data of the tree data structure; Based on the occurrence frequency and the field value of the predetermined field, the root node is constructed into multiple layers of child nodes. The fields corresponding to child nodes at the same level are the same, and the data of the child node is the field value corresponding to the field. The upper-level child node is the parent node of the lower-level child node.
11. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 9.
Citation Information
Patent Citations
Intelligent customs declaration form filling method based on historical data mining
CN110471917A
Data message deduplication and transmission method, electronic equipment and storage medium
CN113055127A