Data mapping method, electronic device, storage medium, and computer program product
Patent Information
- Application Number
- CN202311540486.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-11-17
AI Technical Summary
[0004]显然,前述的加工逻辑所采取的各种模式,在数据发生变化时,都需要通过修改代码以调整加工逻辑,代码修改成本较大
[0005]为了解决前述问题的至少之一,本公开提供了一种数据的映射方法、电子设备、存储介质及计算机程序产品。
Smart Images

Figure CN117520453B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data management, and in particular to a data mapping method, electronic device, storage medium, and computer program product. Background Technology
[0002] In distributed systems, data transfer occurs between service systems, meaning each service system receives data from various sources. Each service system needs to process the received data to form its desired target data, and then perform subsequent processing on the target data, including persistence to a database, sending it to other service systems, or discarding it. The data processing logic of service systems mainly falls into the following patterns: Hard-coded pattern, which follows the principle of "one issue, one solution," where the processing of data input from different service systems is independent and does not affect each other; the processing logic of each type of service system is independently hard-coded in the code; Template method pattern, which abstracts the processing flow of some service systems, unifying the processing steps of the same type of data into fixed steps, with the specific details of each step implemented by the processing code; Layered processing pattern, an improvement on the template method pattern, which persists the received data or sends it to downstream service systems via an interface, and the data is processed by four layers: the receiving layer, the processing layer, the configuration layer, and the terminal processing layer. Data between different layers is processed and transmitted asynchronously through the open-source framework Spring.
[0003] As business grows, the data received by various service systems will change, and the internal data processing logic of the systems will also need to change accordingly. In other words, whenever input data changes or is added, the corresponding processing logic needs to be updated. Typically, updating the processing logic involves: modifying the processing code; testing the modified processing code; and deploying the processing code that performs well in the tests to the corresponding service systems to finally make it effective.
[0004] Clearly, the various processing patterns described above require code modifications to adjust the processing logic whenever the data changes, resulting in significant code modification costs. Furthermore, because these patterns involve cumbersome data processing, when an error occurs at a step, it's necessary to trace back through the code steps to the point of failure, making troubleshooting difficult. Simultaneously, the low reusability of similar processing logic leads to code waste and increased coding costs. Moreover, in the layered processing model, each layer of data needs to be persisted, causing later layers to be compatible with earlier layers, resulting in data redundancy. Summary of the Invention
[0005] To address at least one of the aforementioned problems, this disclosure provides a data mapping method, an electronic device, a storage medium, and a computer program product.
[0006] According to one aspect of this disclosure, a data mapping method is provided, comprising: constructing a mapping relationship group for each of the various service services based on the processing requirements of the receiving end for each expected field in various service services, wherein the mapping relationship group includes processing rules corresponding to each expected field; analyzing received event data and configuring a corresponding mapping relationship group for the event data; and invoking the mapping relationship group to process the event data to form target mapped data, wherein the target mapped data has multiple expected fields that meet the processing requirements.
[0007] In some implementations, analyzing the received event data and configuring the corresponding mapping relationship group for the event data includes: analyzing the event data to determine the event type of the event data; based on the event type, determining the target service corresponding to the event data among multiple service services; and configuring the mapping relationship group associated with the target service to the event data.
[0008] In some implementations, analyzing the event data to determine the event type includes: discretizing the event data to form multiple event fields; identifying a type field in each event field; and using the field value in the type field as the event type of the event data.
[0009] In some implementations, the step of calling the mapping relationship group to process the event data to form target mapping data includes: assigning each mapping relationship to a corresponding event field in the event data according to the source field identifier of each mapping relationship in the mapping relationship group; adjusting the event fields based on the processing rules indicated by the mapping relationships to form the desired fields that meet the processing requirements; and integrating each desired field to form the target mapping data.
[0010] In some implementations, adjusting the event field based on the processing rules indicated by the mapping relationship to form the desired field that meets the processing requirements includes: in response to the mapping relationship being a direct mapping, mapping the field value corresponding to the event field to a field value in the desired field; in response to the mapping relationship being a calculation rule, executing the calculation rule on the field value corresponding to the event field to map the execution result of the calculation rule to a field value in the desired field; in response to the mapping relationship being a fixed value, mapping the fixed value to a field value in the desired field, wherein the fixed value includes a default value and a specified constant; or in response to the mapping relationship being a custom rule, executing the custom rule on the field value corresponding to the event field to map the execution result of the custom rule to a field value in the desired field.
[0011] In some implementations, after adjusting the event field based on the processing rules indicated by the mapping relationship to form the desired field that meets the processing requirements, the method includes: in response to a storage instruction, storing the desired field corresponding to the storage instruction into a data pool.
[0012] In some implementations, after the event data is processed by calling the mapping relationship group to form target mapping data, the method includes: in response to the execution completion status of the mapping relationship group, synchronizing the target mapping data to a target receiving end associated with the group type according to the group type of the mapping relationship group, wherein the target receiving end includes a database and a downstream service system.
[0013] According to another aspect of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a data mapping method as described in any of the above embodiments.
[0014] According to another aspect of this disclosure, a readable storage medium is provided that stores a computer program adapted for loading by a processor to perform a data mapping method as described in any of the above embodiments.
[0015] According to another aspect of this disclosure, a computer program product is provided, including a computer program / instructions that, when executed by a processor, implement the data mapping method as described in any of the above embodiments. Attached Figure Description
[0016] The accompanying drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0017] Figure 1 This is a flowchart illustrating a data mapping method according to an exemplary embodiment of this disclosure.
[0018] Figure 2 This is an architecture diagram of a data mapping method for an exemplary embodiment of this disclosure.
[0019] Figure 3 This is a schematic diagram illustrating the data mapping process of an exemplary embodiment of this disclosure.
[0020] Figure 4 A flowchart illustrating the mapping relationship group configuration for an exemplary implementation of this disclosure.
[0021] Figure 5 A flowchart illustrating the formation of target mapping data is provided for an exemplary embodiment of this disclosure.
[0022] Figure 6 This is a block diagram of a data mapping apparatus for an exemplary embodiment of this disclosure. Detailed Implementation
[0023] The present disclosure will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are for illustrative purposes only and are not intended to limit the scope of the disclosure. Furthermore, it should be noted that, for ease of description, only the parts relevant to the present disclosure are shown in the accompanying drawings.
[0024] It should be noted that, where there is no conflict, the embodiments and features described in this disclosure can be combined with each other. The technical solutions of this disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0025] Unless otherwise stated, the exemplary implementations / embodiments shown are to be understood as providing exemplary features of various details that provide ways in which the technical concepts of this disclosure can be implemented in practice. Therefore, unless otherwise stated, the features of various implementations / embodiments may be additionally combined, separated, interchanged and / or rearranged without departing from the technical concepts of this disclosure.
[0026] The terminology used herein is for the purpose of describing particular embodiments and is not restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms “a” and “the” are intended to include the plural forms as well. Furthermore, when the terms “comprising” and / or “including” and variations thereof are used in this specification, it indicates the presence of the stated features, integrals, steps, operations, parts, components, and / or groups thereof, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, parts, components, and / or groups thereof. It should also be noted that, as used herein, the terms “substantially,” “about,” and other similar terms are used as approximate terms rather than as terms of degree, thus explaining the inherent biases in measurements, calculated values, and / or provided values that would be recognized by one of ordinary skill in the art.
[0027] Figure 1 This is a flowchart illustrating a data mapping method according to an exemplary embodiment of this disclosure. The following is in conjunction with… Figure 1 The steps of the data mapping method S100 of this disclosure are described in detail.
[0028] Step S102: Based on the receiving end's processing requirements for each expected field in various service services, construct a mapping relationship group for each service service.
[0029] The receiving end is a service system that needs to receive data or a database that needs to store data. Of course, when the receiving end is a service system, this service system can also act as another data sender. In addition, the receiving end will put forward corresponding processing requirements based on its actual use case of the data, so as to provide a basis for the subsequent processing of event data.
[0030] Service business refers to the various business scenarios supported by the receiving end. Each service business has a corresponding business type, such as deposit payment type and design fee payment type. Based on different business types, the receiving end puts forward corresponding processing requirements for each service business (at least for service businesses with the same business type) in order to guide the direction of event data processing.
[0031] Expected fields are the various parameters in the data that the receiving end needs to obtain, including at least parameter identifiers and corresponding field values. Each field has a unique parameter identifier, such as "Transaction Time: September 12, 2023," where "Transaction Time" is the parameter identifier and "September 12, 2023" is the field value corresponding to the transaction time; another example is "Transaction Amount: 100 yuan," where "Transaction Amount" is the parameter identifier and "100 yuan" is the field value corresponding to the transaction amount. Integrating all expected fields together forms a complete target mapping data. Of course, in the process of obtaining the field values of the expected fields, it is necessary to call the mapping relationship to process the corresponding event fields of the event data.
[0032] Processing requirements are the expected results of corresponding expected fields proposed by the receiving end, such as "determine the net profit and revenue with an 80% profit margin". Analyzing and extracting processing requirements can form corresponding mapping relationships.
[0033] The mapping relationship is the result of the analysis of processing requirements. Taking the processing requirement as "determine the net profit with an 80% profit margin" as an example, the mapping relationship is extracted based on this, and the corresponding mapping relationship can be determined as "Net profit calculation formula: Transaction amount × 80% = Net profit". If the input event field is "Transaction amount: 100 yuan", calling the mapping relationship to process the event field can form the expected field "Net profit: 80 yuan". In short, the mapping relationship is a processing rule for event fields based on the expected fields of the corresponding service types in the process of various event data services serving various service types of the service system; the mapping relationship group includes all the processing rules corresponding to each expected field, and is a collection of processing rules.
[0034] Step S104: Analyze the received event data and configure the corresponding mapping relationship group for the event data.
[0035] Event data is data emitted by the upstream service system, obtained through monitoring by the system used in this method, or obtained by the upstream service system through input from the interface of the system used in this method. Event data contains one or more pieces of information about the event that occurred. For example, for a payment type event, it includes information such as the transaction amount, transaction time, and payee. Each piece of information is represented as a field, and a corresponding field value is also recorded. In this example, the event field could be "Transaction Amount: 100 yuan," etc., and so on. Clearly, event data includes multiple event fields, which together form partial or complete information about the event. Of course, the field values in the event fields can also be blank; they can be generated based on the actual occurrence of the event and are not restricted.
[0036] Based on the event type of the event data and the multiple business types corresponding to that event type, the mapping relationship groups associated with each business type are extracted. When any mapping relationship group is executed, each mapping relationship in the mapping relationship group will automatically match to the corresponding event field.
[0037] Step S106: Call the mapping relationship group to process the event data to form target mapping data.
[0038] The process of processing event data is the process of mapping each event field into data of the corresponding format and value according to the processing rules indicated in the mapping relationship.
[0039] The target mapping data is the processing result of event data, containing multiple expected fields that meet the processing requirements. These expected fields include parameter identifiers and field values. The information contained in the target mapping data is obtained by processing the event data according to the processing requirements of the receiving end, thus satisfying the business scenario needs of the receiving end. Of course, the expected fields in the target mapping data do not correspond one-to-one with the individual event fields in the event data; there are also cases where multiple event fields are combined to map to a single expected field, all of which fall within the protection scope of this disclosure.
[0040] Figure 2 This is an architecture diagram of a data mapping method according to an exemplary embodiment of this disclosure. The following is in conjunction with… Figure 2 The overall architecture of the data mapping method disclosed herein is explained.
[0041] Once the upstream service system generates event data, it triggers the various steps of the method described above to begin the mapping process of the event data.
[0042] The system receives event data from upstream service systems and discretizes this data into key-value pairs. For example, when the event data is a payment type, the input is a string containing multiple parameters. We split it into formats like "Transaction Amount: 100 yuan", "Transaction Time: September 12, 2023", and "Payee: Zhang San". Here, "Transaction Amount", "Transaction Time", and "Payee" are the parameter identifiers for the various time data, i.e., the "keys" in the key-value pairs; "100 yuan", "September 12, 2023", and "Zhang San" are the field values corresponding to each parameter identifier, i.e., the "values" in the key-value pairs. Extracting and storing each event data in this key-value pair format initializes the data pool, improving the convenience and intuitiveness of retrieving relevant data during subsequent mapping processes. Of course, the data contained in the data pool is dynamic.
[0043] The event data is analyzed to extract fields that characterize the event type, and the value of these fields is used as the event type. For example, if the event data includes "Transaction Type: Payment Received," then the event type for that event data is "Payment Received." Furthermore, based on the event type, at least one corresponding business type is extracted from the event type query configuration table, and the associated service businesses of these business types are organized into a service business set.
[0044] The system queries the various mapping relationship groups associated with each business type to form a set of mapping relationship groups for the corresponding time data. Subsequently, it iterates through each mapping relationship group in the set to process the event data and synchronize it to the service business of each service system, meeting the data access needs of various scenarios. Of course, during this process, the data will also be grouped according to the interface name corresponding to the mapping relationship group and the table name recording the mapping relationship group.
[0045] Before executing each mapping relationship group, it is determined whether all mapping relationship groups related to the event data have been executed. If they have been executed (yes), the mapping process ends directly to avoid redundant calculations caused by repeated execution. If they have not been executed (no), the next mapping relationship group is taken, and each mapping relationship in the mapping relationship group is assigned to the corresponding event field to execute the mapping relationship on each event field to form the corresponding expected field.
[0046] Of course, each time a mapping relationship is executed, it first checks whether all mapping relationships in the current group have been executed. If they have been executed (yes), it checks again whether all mapping relationship groups have been executed, and repeats the above steps based on the different results. Otherwise (no), these mapping relationships are executed to process each event field, map it to the desired field, and form the target mapping data.
[0047] Furthermore, it is determined whether there are any related storage instructions for the obtained expected fields. If so, the expected fields indicated by the storage instructions are placed in the data pool for later retrieval as needed. Then, depending on the group type of the mapping relationship group, the target mapping data is persisted to the database or mapped to the downstream service system to complete the target mapping data synchronization process. Otherwise (no), the target mapping data is directly synchronized to the database or downstream service system. By selectively storing expected fields, data redundancy is avoided.
[0048] Of course, before mapping the target mapping data to the corresponding receiving end, it is necessary to select the receiving end based on the group type associated with the mapping relationship group. For example, when the group type is kind=1, it means that the receiving end of the obtained target mapping data is a database; if the group type is kind=2, it means that the receiving end of the obtained target mapping data is a downstream service system, and then the interface will be called to map the target mapping data to the corresponding downstream service system. Of course, the selection of the interface or the database is specified in the table corresponding to the mapping relationship group.
[0049] Repeat the aforementioned steps until all service business mapping relationships have been executed, then the entire mapping process ends.
[0050] Figure 3 This is a schematic diagram illustrating the data mapping process of an exemplary embodiment of this disclosure.
[0051] refer to Figure 3 This example demonstrates the specific mapping process for event data. When the receiving layer receives event data, it first divides it into multiple event fields, such as event field A, event field B, event field C through event field N. The total number of event fields is not limited and is set according to the actual situation of the event data. The role of the receiving layer is to store the event data from the upstream service system in the data pool.
[0052] The mapping layer is primarily used to configure the mapping relationships between fields, based on the mapping between "event type - business type". The mapping layer performs the mapping of relevant fields in the data pool according to these relationships. The mapping layer supports at least two receiving ends: a database and an external service system. When the receiving end is a database, the mapping results are directly stored in the database. If the receiving end is an external service system, the mapping results are synchronized to the external service system by calling its interface. Here, "database" includes database 1, etc., and the number is not limited; "external service system interface" includes external service system interface 1, etc., and is not listed exhaustively.
[0053] When the receiving end is a database, the mapping layer stores some fields of the target mapped data in the database for easy access by system configuration personnel, while reducing the storage of redundant data. The mapping process mainly involves: selecting at least one corresponding business type based on the event type, extracting all mapping relationship groups within that business type, and then calling each mapping relationship in the mapping relationship group to process the corresponding event fields to form the expected fields. The expected fields include two types: external synchronization fields and stored fields.
[0054] For example, a group of mapping relationships is retrieved with database 1 as the mapping endpoint. This group contains two mapping relationships: one corresponding to event field A and the other to event field B. After the mapping relationship, event field A is mapped to storage field 1 and stored in database 1; similarly, event field B is mapped to storage field 2 and stored in database 1. The selection of fields stored in the database can be set according to the needs of the system configuration personnel and is not restricted here. Another group of mapping relationships uses event fields and external synchronization fields as the starting and ending points of the mapping path. This group contains multiple mapping relationships, including one corresponding to event field C and the other to event field N. After the mapping relationship processing, event field C is mapped to external synchronization field c, and event field N is mapped to external synchronization field m. The intermediate mapping relationships and processes are not detailed here. Of course, multiple event fields can be mapped to the same external synchronization field. Therefore, event fields and external synchronization fields, and even storage fields, are not in a one-to-one correspondence. All correspondences fall within the protection scope of this disclosure. Another mapping group uses the stored field and the external synchronization field as the starting and ending points of the mapping path. This group also has two mapping relationships, including a mapping relationship corresponding to stored field 1 and a mapping relationship corresponding to stored field 2. After the mapping relationship is processed, stored field 1 is mapped to external synchronization field a, and stored field 2 is mapped to external synchronization field b.
[0055] Figure 4 A flowchart illustrating the mapping relationship group configuration for an exemplary implementation of this disclosure.
[0056] like Figure 4 As shown, in some embodiments, the execution process of step S104 includes: step S1041, analyzing the event data to determine the event type of the event data; step S1042, based on the event type, determining the target service corresponding to the event data among multiple service services; and step S1043, configuring the mapping relationship group associated with the target service to the event data.
[0057] Specifically, when determining the event type, the method is as follows: the event data is discretized into multiple event fields; the type field is identified in each event field, and the field value in the type field is used as the event type of the event data.
[0058] Figure 5 This is a flowchart illustrating the formation of target mapping data in an exemplary embodiment of this disclosure.
[0059] like Figure 5As shown, the execution process of step S106 includes: step S1061, assigning each mapping relationship to the corresponding event field in the event data according to the source field identifier of each mapping relationship in the mapping relationship group; step S1062, adjusting the event field based on the processing rules indicated by the mapping relationship to form the expected field that meets the processing requirements; and step S1063, integrating each expected field to form the target mapping data.
[0060] The mapping methods for event fields include the following: When the mapping relationship is direct mapping, the field value corresponding to the event field is mapped to the field value in the expected field; when the mapping relationship is a calculation rule, the calculation rule is executed on the field value corresponding to the event field to map the execution result of the calculation rule to the field value in the expected field; when the mapping relationship is a fixed value, a fixed value is mapped to the field value in the expected field, where the fixed value includes default values and specified constants; or when the mapping relationship is a custom rule, a custom rule is executed on the field value corresponding to the event field to map the execution result of the custom rule to the field value in the expected field.
[0061] When the mapping rule is a fixed value, the field value in the event field can be empty.
[0062] In some implementations, after forming the desired field, the method includes: in response to a storage instruction, storing the desired field corresponding to the storage instruction into a data pool.
[0063] In some implementations, after the target mapping data is formed, the process includes: in response to the execution completion status of the mapping relationship group, synchronizing the target mapping data to the target receiving end associated with the group type, wherein the target receiving end includes a database and a downstream service system.
[0064] This disclosure proposes a data mapping method that configures mapping relationships according to the needs of the receiving end, directly mapping input event data to expected data. The path is simple, and when problems occur, the source can be traced through a single mapping path. Furthermore, data mapping relationships between the same event type can be shared, exhibiting reusability and avoiding the tedious and costly process of allocating code to each related technology. Additionally, the mapping results are selectively stored in the database according to storage instructions, avoiding redundant data in the database and improving the efficiency and convenience for system configuration personnel to retrieve data.
[0065] Figure 6 This is a block diagram of a data mapping apparatus for an exemplary embodiment of this disclosure.
[0066] like Figure 6As shown, this disclosure proposes a data mapping device 1000, comprising: a mapping relationship group construction module 1002, used to construct mapping relationship groups for various service services based on the processing requirements of each expected field in various service services of the receiving end, wherein the mapping relationship group includes the corresponding processing rules for each expected field; an allocation module 1004, used to analyze the received event data and configure the corresponding mapping relationship group for the event data; and a data processing module 1006, used to call the mapping relationship group to process the event data to form target mapping data, wherein the target mapping data has multiple expected fields that meet the processing requirements.
[0067] The various modules of the data mapping device 1000 are proposed to implement the various steps of the data mapping method. Their execution process and implementation principle can be referred to the foregoing, and will not be repeated here.
[0068] The device 1000 may include corresponding modules that perform one or more steps in the flowchart described above. Therefore, each or more steps in the flowchart can be performed by a corresponding module, and the device may include one or more of these modules. A module may be one or more hardware modules specifically configured to perform a corresponding step, or implemented by a processor configured to perform a corresponding step, or stored in a computer-readable medium for implementation by a processor, or implemented through some combination thereof.
[0069] This hardware architecture can be implemented using a bus architecture. The bus architecture can include any number of interconnect buses and bridges, depending on the specific application and overall design constraints of the hardware. Bus 1100 connects various circuits, including one or more processors 1200, memory 1300, and / or hardware modules. Bus 1100 can also connect various other circuits 1400, such as peripherals, voltage regulators, power management circuits, external antennas, etc.
[0070] Bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one connection line is used in this diagram, but this does not imply that there is only one bus or only one type of bus.
[0071] Any process or method description in the flowcharts or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain. The processor performs the various methods and processes described above. For example, the method embodiments of this disclosure may be implemented as software programs tangibly contained in a machine-readable medium, such as memory. In some embodiments, part or all of the software program may be loaded and / or installed via memory and / or a communication interface. When the software program is loaded into memory and executed by the processor, one or more steps of the methods described above may be performed. Alternatively, in other embodiments, the processor may be configured to perform one of the methods described above by any other suitable means (e.g., by means of firmware).
[0072] The logic and / or steps represented in the flowchart or otherwise described herein may be specifically implemented in any readable storage medium for use by, or in conjunction with, an instruction execution system, apparatus or device (such as a computer-based system, a processor-included system or other system that can fetch and execute instructions from, an instruction execution system, apparatus or device).
[0073] For the purposes of this specification, a "readable storage medium" can be any means capable of containing, storing, communicating, propagating, or transmitting a program for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and programmable read-only memory (EPROM or flash memory), fiber optic devices, and portable read-only memory (CDROM). Furthermore, a readable storage medium can even be paper or other suitable media on which a program can be printed, since a program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in memory.
[0074] It should be understood that various parts of this disclosure can be implemented in hardware, software, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0075] Those skilled in the art will understand that all or part of the steps of the methods described above can be implemented by a program instructing related hardware, and the program can be stored in a readable storage medium. When executed, the program includes one or a combination of the steps of the method implementation.
[0076] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a single processing module, or each unit can exist physically separately, or two or more units can be integrated into a single module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a readable storage medium. The storage medium can be a read-only memory, a disk, or an optical disk, etc.
[0077] Those skilled in the art should understand that the above embodiments are merely for illustrating the present disclosure and are not intended to limit the scope of the disclosure. Those skilled in the art can make other changes or modifications based on the above disclosure, and these changes or modifications still fall within the scope of the present disclosure.
Claims
1. A data mapping method, characterized in that, include: Based on the receiving end's processing requirements for each expected field in various service services, a mapping relationship group is constructed for each of the service services, wherein the mapping relationship group includes the corresponding processing rules for each expected field; The received event data is analyzed, and the corresponding mapping relationship group is configured for the event data; as well as The event data is processed by calling the mapping relationship group to form target mapping data, wherein the target mapping data has multiple expected fields that meet the processing requirements; The step of analyzing the received event data and configuring the corresponding mapping relationship group for the event data includes: The event data is analyzed to determine the event type. Based on the event type, a target service corresponding to the event data is determined from among the multiple service services; and Configure the mapping relationship group associated with the target service to the event data; The process of calling the mapping relationship group to process the event data to form target mapping data includes: Based on the source field identifier of each mapping relationship in the mapping relationship group, each mapping relationship is assigned to the corresponding event field in the event data; Based on the processing rules indicated by the mapping relationship, the event fields are adjusted to form the desired fields that meet the processing requirements; and The desired fields are integrated to form the target mapping data.
2. The data mapping method according to claim 1, characterized in that, The analysis of the event data to determine the event type includes: The event data is discretized to form multiple event fields; Identify the type field in each event field, and use the field value in the type field as the event type of the event data.
3. The data mapping method according to claim 1, characterized in that, The adjustment of the event field based on the processing rules indicated by the mapping relationship to form the desired field that meets the processing requirements includes: In response to the mapping relationship being a direct mapping, the field value corresponding to the event field is mapped to the field value in the expected field; In response to the mapping relationship being a calculation rule, the calculation rule is executed on the field value corresponding to the event field, so as to map the execution result of the calculation rule to the field value in the expected field; In response to the mapping relationship being a fixed value, the fixed value is mapped to a field value in the desired field, wherein the fixed value includes a default value and a specified constant; or In response to the mapping relationship being a custom rule, the custom rule is executed on the field value corresponding to the event field to map the execution result of the custom rule to the field value in the desired field.
4. The data mapping method according to claim 1, characterized in that, After adjusting the event field according to the processing rules indicated by the mapping relationship to form the desired field that meets the processing requirements, the process includes: In response to a storage instruction, the desired field corresponding to the storage instruction is stored in the data pool.
5. The data mapping method according to claim 1 or 4, characterized in that, After the event data is processed by calling the mapping relationship group to form the target mapping data, the process includes: In response to the execution completion status of the mapping relationship group, the target mapping data is synchronized to the target receiving end associated with the group type according to the group type of the mapping relationship group, wherein the target receiving end includes a database and a downstream service system.
6. An electronic device, characterized in that, It includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement a data mapping method as described in any one of claims 1 to 5.
7. A readable storage medium, characterized in that, The readable storage medium stores a computer program adapted for loading by a processor to execute the data mapping method as described in any one of claims 1 to 5.
8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the data mapping method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Block chain-based evidence storage data generation method and apparatus, and computer device
CN115510154A
Data processing method and system and related equipment
CN115840748A