A data processing method and device
By receiving query conditions and input data, determining the data to be processed based on the template identity and template element information table, and adjusting its value according to the assignment conditions, it solves the problem of multi-dimensional data processing to be processed and realizes the simplicity and scalability of the program. sex.
Patent Information
- Application Number
- CN202210299471.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-25
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2042-03-25
AI Technical Summary
Before the pending data is dropped from the database, it is difficult for the prior art to effectively process multi-dimensional pending data, which makes it difficult to write, maintain and expand program code.
By receiving the query conditions and input data sent by the caller, the data to be processed is determined based on the template identity and the template element information table, and is processed according to the assignment conditions and input data of the data to be processed, and the value of the data to be processed is adjusted.
It simplifies program writing and maintenance, reduces maintenance costs, and improves the flexibility and scalability of data processing.
Smart Images

Figure CN114791921B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and in particular, relates to a data processing method and device. Background Art
[0002] After the data to be processed is assigned a value, it is written into the database, completing the storage of the data to be processed. One piece of data to be processed can correspond to multiple data tables, and each data table includes multiple fields, so that the dimensions of the data to be processed are more. For example, the data to be processed P = {a1,…,a i …,a n1 ,b1,…,b i …,b n2 ,…,m1,…,m i …,m n3}, where a, b and m are data tables, a i 、b i and m i Represent the i-th field in data tables a, b and m respectively, then the dimension of the data to be processed is the sum of the number of fields in all data tables.
[0003] Before the data to be processed is stored in the database, the values of each field in the data table are used to assign values to the data to be processed, where the data table can be regarded as input data. When assigning values to the data to be processed, the values of the fields are read from the input data and assigned to the elements corresponding to the data to be processed through the written program code. Therefore, each element in the data to be processed can be assigned using the program code, so that the number of lines of program code increases as the number of elements in the data to be processed increases. If the elements of the data to be processed change, the program code needs to be modified adaptively, which increases the difficulty of writing, maintaining and expanding the program code. Summary of the invention
[0004] This application provides a data processing method and device. The technical solution is as follows:
[0005] In a first aspect, the present application provides a data processing method, the method comprising:
[0006] Receive query conditions and input data sent by the caller;
[0007] Based on the query condition, searching for a target template identity identifier that matches the query condition from multiple template identity identifiers;
[0008] Determining data to be processed based on a template element information table that matches the target template identity identifier;
[0009] Based on the assignment condition of the data to be processed and the input data, the data to be processed is processed, wherein the assignment condition of the data to be processed is used to indicate whether to adjust the value of the data to be processed using the input data;
[0010] Sending the processed data to be processed to the caller.
[0011] Optionally, the processing the data to be processed based on the assignment condition of the data to be processed and the input data includes:
[0012] If the element level of the element in the data to be processed is the first level, ignore the element;
[0013] If the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to a null value;
[0014] If the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to a default value;
[0015] If the element level of the element in the data to be processed is the fourth level, maintaining the value of the element as a default value;
[0016] If the element level of the element in the data to be processed is the fifth level, the value of the element is adjusted to the value of the target field in the target data table.
[0017] Optionally, the target data table and the target field are determined based on a regular expression of an element at a fifth level.
[0018] Optionally, searching for a target template identity that matches the query condition from multiple template identities based on the query condition includes:
[0019] Based on the query condition, a target template information table matching the query condition is found from multiple template information tables; and the target template identity is extracted from the target template information table.
[0020] Optionally, the template information table includes a template identification field and a query field for querying the template information table; the template element information table includes a template identification field and a positioning field for locating the data to be processed; before receiving the query conditions and the input data, the fields in the template information table and the template element information table are assigned values.
[0021] Optionally, searching for a target template information table matching the query condition from multiple template information tables based on the query condition includes:
[0022] Compare the query fields in the multiple template information tables with the query conditions respectively to obtain the query fields matching the query conditions, and the template information table where the query fields matching the query conditions are located is the target template information table;
[0023] The values of the template identity fields in the target template element information table and the target template information table are the same.
[0024] Optionally, the determining the data to be processed based on the template element information table matching the target template identity identifier includes:
[0025] Based on the value of the area field and / or the value of the category field in the template element information table matching the target template identity, determine the data table pointed to by the value of the area field and / or the value of the category field, the data table being the data to be processed;
[0026] or
[0027] Based on the value of the area field in the template element information table that matches the target template identity, the area pointed to by the value of the area field is determined, and the data located in the area is the data to be processed.
[0028] In a second aspect, the present application provides a data processing device, the device comprising:
[0029] A receiving unit, used for receiving query conditions and input data sent by the caller;
[0030] A searching unit, configured to search for a target template identity that matches the query condition from a plurality of template identities based on the query condition;
[0031] A determination unit, configured to determine the data to be processed based on the template element information table matching the target template identity identifier;
[0032] a processing unit, configured to process the data to be processed based on the assignment condition of the data to be processed and the input data, wherein the assignment condition of the data to be processed is used to indicate whether to adjust the value of the data to be processed using the input data;
[0033] The sending unit is used to send the processed data to be processed to the caller.
[0034] Optionally, the processing unit is configured to ignore the element if the element level of the element in the data to be processed is the first level;
[0035] If the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to a null value;
[0036] If the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to a default value;
[0037] If the element level of the element in the data to be processed is the fourth level, maintaining the value of the element as a default value;
[0038] If the element level of the element in the data to be processed is the fifth level, the value of the element is adjusted to the value of the target field in the target data table.
[0039] Optionally, the target data table and the target field are determined based on a regular expression of an element at a fifth level.
[0040] Optionally, the search unit is used to search for a target template information table matching the query condition from multiple template information tables based on the query condition; and extract the target template identity from the target template information table.
[0041] Optionally, the template information table includes a template identification field and a query field for querying the template information table; the template element information table includes a template identification field and a positioning field for locating the data to be processed; before receiving the query conditions and the input data, the fields in the template information table and the template element information table are assigned values.
[0042] Optionally, the search unit is used to compare the query fields in the multiple template information tables with the query conditions respectively to obtain query fields that match the query conditions, and the template information table where the query fields that match the query conditions are located is the target template information table; the values of the template identity fields in the target template element information table and the target template information table are the same.
[0043] Optionally, the determination unit is used to determine the data table pointed to by the value of the area field and / or the value of the category field in the template element information table matching the target template identity, and the data table is the data to be processed;
[0044] or
[0045] The determination unit is used to determine the area pointed to by the value of the area field in the template element information table matching the target template identity, and the data located in the area is the data to be processed.
[0046] In a third aspect, the present application provides an electronic device, comprising: one or more processors and a memory; wherein the memory is used to store one or more computer program codes, the computer program codes comprising computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs the above-mentioned data processing method.
[0047] In a fourth aspect, the present application provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned data processing method.
[0048] It can be seen from the above technical solution that after the data to be processed is processed based on the assignment conditions of the data to be processed and the input data, the processed data to be processed is sent to the caller for use. Because the assignment conditions of the data to be processed can indicate whether to adjust the value of the data to be processed, if the value of the data to be processed can be adjusted based on the input data, it means that for all elements in the data to be processed, the values of some elements in the data to be processed can be adjusted, and the values of some elements in the data to be processed can remain unchanged.
[0049] When the data to be processed is updated (such as product updates or updates caused by iterating new products), the amplitude conditions of the elements in the data to be processed can also be modified to reduce the number of modifications to the program that implements the data processing method. In addition, the judgment of the data to be processed is mainly concentrated in the template element information table, which makes the program more concise, and the readability and scalability are greatly increased. Maintenance is also mainly concentrated on the maintenance of the template element information table. The maintenance cost of the template element information table is much lower than the maintenance cost of the program, so the maintenance cost can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0051] Figure 1 is a flow chart of a data processing method provided in an embodiment of the present application;
[0052] Figure 2 It is a scenario schematic diagram of a data processing method provided in an embodiment of the present application;
[0053] Figure 3 is a flow chart of another data processing method provided in an embodiment of the present application;
[0054] Figure 4 It is a structural diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0056] See also Figure 1 , which shows a data processing method provided by an embodiment of the present application, which may include the following steps:
[0057] 101. Receive query conditions and input data sent by the caller. The caller may be a user who reads data from a database. In some scenarios, different callers require different values for the same field. Therefore, when the caller reads data from the database, the data read by the caller (called pending data) can be determined according to the caller's needs, and the pending data can be assigned values.
[0058] The query condition is used to determine the data to be processed, and the input data is used to assist the assignment operation of the data to be processed. The input data includes the values of multiple fields, and the values of these fields are assigned on the caller side. When the caller reads the data to be processed from the database, the values of the fields in the input data are used to assist the assignment operation of the data to be processed. For example, one auxiliary method is to replace the values of the elements in the data to be processed with the values of the fields in the input data.
[0059] 102. Based on the query condition, find a target template identity identifier that matches the query condition from multiple template identity identifiers.
[0060] The target template identity matching the query condition may be the target template identity pointed to by the query condition among the multiple template identities, that is, the query condition may uniquely point to one target template identity.
[0061] One feasible way to query the condition is to establish a corresponding relationship between the query condition and the template identity. After receiving the query condition sent by the caller, find a template identity corresponding to the query condition, and the template identity is the target template identity.
[0062] In this embodiment, the database may be configured with a template information table, the template information table including a template identity and a query field for querying the template information table. The query condition may be input with reference to the query field, for example, the query condition may at least include the value of the query field, and the method of searching for the target template identity based on the query condition may be: based on the query condition, searching for a target template information table matching the query condition from multiple template information tables; and extracting the target template identity from the target template information table.
[0063] For example, after receiving the query conditions, the query fields in the multiple template information tables are respectively compared with the query conditions to obtain the query fields that match the query conditions, and the template information table where the query fields that match the query conditions are located is the target template information table. The comparison can be to compare the value of the query field in the query conditions with the value of the query field in each template information table to determine the target template information table that matches the query conditions (i.e., the template information table where the extracted query field value is located), and the template identity in the target template information table is the target template identity.
[0064] One form of the template information table is: template information table (template identity, business identity, organization identity, channel), where the business identity, organization identity and channel are query fields in the template information table, the business identity is used to specify the business targeted by the template information table, and the organization identity and channel are used to specify the source of the template information table. The organization identity may include an organization code and an organization name to point to an organization through the organization code and organization name, and the channel is used to point to the path of the template information table.
[0065] When the template information table targets different businesses and channels, the values of the business identifier, organization identifier, and channel fields are different, so the query conditions sent by the caller can be information related to the business identifier, organization identifier, and channel. For example, the query conditions give the business identifier, organization identifier, and channel, indicating the business and source targeted by the query conditions, so that a template information table is matched based on the business and source, and the matched template information table can be called the target template information table.
[0066] In addition to the above template identification, business identification, organization identification, and channel, the template information table may also include other fields. For example, another form of the template information table is: template information table (template identification, business type, organization code, organization name, channel, reserved dimension 1, reserved dimension 2, remarks, operator code, operator name, operating organization code, operating organization name, operation date, operation time, spare 1, spare 2, spare 3, spare 4, spare 5, spare 6).
[0067] Reserved Dimension 1 and Reserved Dimension 2 are used when querying the template information table, which is equivalent to the query field. If multiple template identifiers are found based on business type, organization code, organization name, and channel, other query conditions can be added to Reserved Dimension 1 and / or Reserved Dimension 2. For example, Reserved Dimension 1 is adjusted to the organization address, and Reserved Dimension 2 is adjusted to the caller identity, thereby adding two query fields, the organization address and the caller identity, on the basis of business type, organization code, organization name, and channel, and searching the template information table through more dimensions to improve accuracy.
[0068] Operator code, operator name, operator organization code, operator organization name, operation date and operation time are used to record personnel operations on the template information table, such as updating the operator code, operator name, operator organization code, operator organization name, operation date and operation time after adjusting reserved dimension 1 and / or reserved dimension 2. Remarks are used to explain the template information table. Spare 1 to Spare 6 are used to expand the fields of the template information table.
[0069] In addition, the template identities of different template information tables are also different. One feasible way to query the condition is that the query condition carries the template identity, and the template identity in the query condition is determined as the target template identity. For example, the query condition can be the template identity. If the query condition is the template identity, the caller must obtain the template identities of most / all template information tables in advance. After the template identity of any template information table is updated, the caller must also update the template identity in a timely manner, otherwise processing errors will occur.
[0070] The template identification can be a template ID (Identity Document, identification number), such as a template number. The template name is also a form of template identification, and a template information table can be uniquely pointed to by the template name, so the query condition can be the template ID and / or the template name.
[0071] 103. Determine the data to be processed based on the template element information table that matches the target template identity.
[0072] The template element information table matched by the target template identity may be the template element information table pointed to by the target template identity. Multiple template element information tables may be configured in the database, and the template element information table may include a template identity field and a location field for locating the data to be processed. The template identity field records the template identity of the template element information table, and the location field records the location of the data to be processed.
[0073] After determining the target template identity, the template identity of each template element information table is compared with the target template identity to determine the template identity that is the same as the target template identity. The template element information table where the template identity is located can be determined as the template element information table that matches the target template identity. Then, based on the positioning field in the template element information table, the data to be processed is determined.
[0074] The positioning field may include an area field and a category field. The area field may indicate that the data belongs to the first category. The category field may indicate that the data belongs to the second category. The second category is a subcategory under the first category. Therefore, one way to determine the data to be processed in this embodiment is to determine the data table pointed to by the value of the area field and / or the value of the category field in the template element information table that matches the target template identity, and the data table is the data to be processed. For example, the value of the area field points to the first category, and the data in the data table belonging to the first category is determined as the data to be processed; the value of the category points to the second category, and multiple second categories can be recorded under the category field in the template element information table, each second category points to a type of data table, and the data in the data table belonging to the second category is determined as the data to be processed.
[0075] In addition, the area field can indicate the area where the data is located. Correspondingly, one way to determine the data to be processed may be to determine the area pointed to by the value of the area field based on the value of the area field in the template element information table that matches the target template identity, and the data located in the area is the data to be processed.
[0076] In this embodiment, one form of the template element information table is (template ID, element ID, English name, Chinese name, front-end name, area, category, order in the category, type, length, whether it is required, whether null values are allowed, whether it is displayed on the front desk, dictionary category, dictionary value range, default value, verification rules, verification rules for business types, element level, operator code, operator name, operating organization code, operating organization name, operation date, operation time, remarks, spare 1, spare 2, spare 3, spare 4, spare 5, spare 6, spare 7, spare 8).
[0077] Among them, the template ID is the template identity in the template element information table, the region and category are used to determine the data to be processed, and the element level is used to determine whether to adjust the value of the data to be processed. Therefore, except for the template ID, region, category and element level, other fields are optional fields in the template element information table. The element ID is related to the data to be processed and can indicate which business it belongs to. For example, the element ID can be a loan element ID, which indicates that the data to be processed is related to loans.
[0078] The order in the classification is related to the classification to which it belongs, and is used to indicate the order between the second classifications recorded under the classification to which it belongs. The English name, Chinese name and front-end name are used to indicate the name of the template element information table. Type, length, whether it is required (must be entered), whether control is allowed, whether it is displayed at the front desk, dictionary type, dictionary value range and default value can be some attributes of the data to be processed. Verification rules and verification rules for business varieties are used for data verification. Operator code, operator name, operating agency code, operating agency name, operation date and operation time are used to record personnel's operations on the template element information table. Remarks are used to explain the template element information table. Spare 1 to spare 8 are used to expand the fields of the template element information table.
[0079] Here we need to explain that the database includes multiple template information tables and multiple template element information tables. Both the template information tables and the template element information tables have template identity fields. Before receiving the query conditions and input data, the fields in the template information tables and the template element information tables are assigned values. In the scenario where the target template identity is found by referring to the template information table, the template identity fields in the target template information table and the target template element information table have the same value, and the template identities in these two tables can be called target template identities.
[0080] 104. Based on the assignment condition of the data to be processed and the input data, the data to be processed is processed, wherein the assignment condition of the data to be processed is used to indicate whether to adjust the value of the data to be processed using the input data. In other words, the assignment condition of the data to be processed is used to indicate whether to adjust the value of the data to be processed, and if the value of the data to be processed is adjusted, it can be adjusted based on the input data. One adjustment method can be to replace the value of the element in the data to be processed with the value of the field in the input data. In addition, the assignment condition of the data to be processed can also indicate whether the caller needs the data to be processed.
[0081] In this embodiment, the assignment condition of the data to be processed may be the assignment condition of the elements in the data to be processed. The element has different element levels, and the processing method for the value of the element is also different. One processing method is as follows:
[0082] If the element level of the element in the data to be processed is the first level, the element is ignored; if the element level of the element is the first level, it means that the caller does not need to use the element, so the element is ignored and the value of the element with the first level is not adjusted.
[0083] If the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to an empty value; if the element level is the second level, it means that the caller uses the element and the input data sent by the caller shall prevail.
[0084] Before assigning a value to an element at the second level, first determine whether there is a field matching the element in the input data. A field matching the element means that the meaning of the element is the same as or close to that of the field. If there is a field matching the element in the input data, adjust the value of the element to the value of the matching field, that is, replace the value of the element with the value of the field matching the element in the input data; if there is no field matching the element in the input data, adjust the value of the element to a null value.
[0085] If the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to the default value. If the element level of the element is the third level, it means that the caller uses the element and the input data sent by the caller is used as the basis. The adjustment method is different from the second-level elements. The difference is that if there is no field matching the element in the input data, the value of the element is adjusted to the default value, which can be the default value in the template element information table.
[0086] If the element level of the element in the data to be processed is the fourth level, the value of the element is maintained as the default value, that is, the value of the element is kept unchanged, and the value of the element is the default value in the template element information table.
[0087] If the element level of the element in the data to be processed is the fifth level, the value of the element is adjusted to the value of the target field in the target data table. The target field is a field in the target data table. For an element with a fifth level of element level, a target data table and a target field can be specified in advance for the element, and the value of the target field is replaced with the value of the element. One way to specify the target data table and the target field can be determined based on a regular expression of the element with a fifth level of element level.
[0088] For an element whose feature level is the fifth level, a regular expression is configured for the element in advance. The regular expression can be used to match a target data table from multiple data tables, and then match a target field from the target data table.
[0089] 105. Send the processed data to the caller.
[0090] After the data to be processed is processed based on the assignment conditions of the data to be processed and the input data, the processed data to be processed is sent to the caller for use. Because the assignment conditions of the data to be processed can indicate whether to adjust the value of the data to be processed, if the value of the data to be processed can be adjusted based on the input data, it means that for all elements in the data to be processed, the values of some elements in the data to be processed can be adjusted, and the values of some elements in the data to be processed can remain unchanged. For elements whose values can be adjusted, their assignment conditions are adjusted, such as adjusting the element level of the template element information table where the element is located. The element level can indicate the assignment conditions of the element.
[0091] When the data to be processed is updated (such as product updates or updates caused by iterating new products), the amplitude conditions of the elements in the data to be processed can also be modified to reduce the number of modifications to the program that implements the data processing method. And the judgment of the data to be processed is mainly concentrated in the template element information table, which makes the program more concise, and the readability and scalability are greatly increased. Maintenance is also mainly concentrated on the maintenance of the template element information table. The maintenance cost of the template element information table is much lower than the maintenance cost of the program, so the maintenance cost can be reduced. The judgment can be whether the value of the data to be processed is adjusted, and the maintenance can be to modify the element level, etc.
[0092] Taking the contract signing in the loan business as an example, one form of the data to be processed can be P = {a1,…,a i …,a n1 ,b1,…,b i …,b n2 ,…,m1,…,m i …,m n3}, the data to be processed include the personal loan contract basic table, the personal loan contract interest rate information table, the personal asset information table, etc. When different callers call the data to be processed, the data to be processed used by different callers may be different. Therefore, the caller can adjust the value of the data to be processed based on the input data.
[0093] One adjustment method is that after obtaining the data to be processed, the element level of the element in the data to be processed is determined from the template element information table, and whether to adjust the value of the element is determined according to the element level of the element. For example, the element level includes the first level, the second level, the third level, the fourth level and the fifth level, wherein the first level indicates to ignore the element, and the fourth level indicates to maintain the value of the element as the default value. If the element level is the first level or the fourth level, the value of the element does not need to be adjusted. When the element level of the element is any one of the second level, the third level and the fifth level, the value of the element is adjusted based on the adjustment method corresponding to the element level, thereby for all elements in the data to be processed, the values of the elements with the element levels of the second level, the third level and the fifth level can be adjusted, reducing the number of elements to be adjusted. Moreover, whether the value of the element is adjusted is based on the element level. In this embodiment, the element level in the template element information table can be maintained to realize the value control of the element. Compared with using a program to control the value adjustment of the data to be processed, the number of program modifications is reduced and the maintenance cost is reduced.
[0094] In the process of processing the data table of the loan business, this embodiment can find the target template identity based on the query condition, and then determine the data to be processed based on the template element information table matched by the target template identity. The following takes the template information table and the template element information table as an example and combines a scenario to illustrate the data processing method provided by this embodiment. Figure 2 As shown, the data processing method provided in this embodiment is executed by the credit business middle-office system, and the caller can access the credit business middle-office system and obtain the data to be processed after the value is adjusted from the credit business middle-office system. The credit business middle-office system plays the role of a bridge connecting the front and back ends in the banking system architecture, penetrating barriers such as internal department walls of the enterprise, providing sharable and reusable credit business capabilities, supporting rapid innovation and iteration at a low cost at the front end, with flexibility at the front end and stability at the back end. The caller can be an associated system of the consumer.
[0095] The consumer's associated system sends input parameters to the credit business middle-office system, where the input parameters include query conditions and input data. The credit business middle-office system integrates a template information reading method, a template element information reading method, and a template element processing method. The credit business middle-office system calls the template information reading method, and based on the business type, institution code, institution name, and channel in the query conditions, it searches for the template information table containing the business type, institution code, institution name, and channel from multiple template information tables in the database, identifies the template information table as the target template information table, and extracts the target template ID (a form of target template identity) from the target template information table.
[0096] After obtaining the target template ID, the credit business middle office system calls the template element information reading method, searches for the template element information table where the target template ID is located from multiple template element information tables in the database, determines the template element information table as the target template element information table, and reads the area and category from the target template element information table to determine the data to be processed. Then the credit business middle office system calls the template element processing method, which processes the data to be processed according to the element level. The process of processing the data to be processed according to the element level is as follows:
[0097] If the element level of an element in the data to be processed is the first level, the element is ignored, and the element may not be fed back when the data to be processed is sent to the associated system of the consumer;
[0098] If the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to a null value;
[0099] If the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field; if there is no field matching the element in the input data, the value of the element is adjusted to the default value;
[0100] If the element level of the element in the data to be processed is the fourth level, the value of the element is maintained as the default value, that is, the value of the element remains unchanged;
[0101] If the element level of the element in the data to be processed is the fifth level, according to the regular expression corresponding to the element, the target data table is determined from multiple data tables and the target field is determined from the target data table, and the value of the element is adjusted to the value of the target field.
[0102] After completing the adjustment of the data to be processed, the elements at the second, third, fourth and fifth levels are sent to the consumer's associated system (i.e., the caller) in the form of key-value pairs. Key-value pairs are a form of data organization, denoted as Map<key,value> , the key is the number of the element, and the value is the value of the element.
[0103] The above data processing method is further described with a flow chart, which may include the following steps:
[0104] 201. Obtain query conditions and input data, the query conditions including business type, agency code, agency name and channel, etc.
[0105] 202. Based on the query condition, a target template information table containing the query condition is found from multiple template information tables, and a target template ID is extracted from the target template information table.
[0106] 203. Determine the data to be processed based on the area and category in the template element information table where the target template ID is located.
[0107] 204. Determine the element level in the template element information table where the target template ID is located. When the element level is the first level, the second level, the third level, the fourth level, or the fifth level, proceed according to step 205.
[0108] 205. If the element level of the element in the data to be processed is the first level, the element is ignored, and the element may not be fed back when the data to be processed is sent to the associated system of the consumer; if the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field, and if there is no field matching the element in the input data, the value of the element is adjusted to a null value; if the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, the value of the element is adjusted to the value of the matching field, and if there is no field matching the element in the input data, the value of the element is adjusted to a default value; if the element level of the element in the data to be processed is the fourth level, the value of the element is maintained as the default value, that is, the value of the element is kept unchanged; if the element level of the element in the data to be processed is the fifth level, according to the regular expression corresponding to the element, a target data table is determined from multiple data tables and a target field is determined from the target data table, and the value of the element is adjusted to the value of the target field.
[0109] 206. Based on the region and category in the template element information table where the target template ID is located, obtain the element based on the element level assignment, and map it to<key,value> Save the form.
[0110] For all elements in the data to be processed, the values of the elements at the second level, the third level, and the fifth level can be adjusted to reduce the number of elements to be adjusted. Whether the value of the element is adjusted is based on the element level. This embodiment can maintain the element level in the template element information table to achieve control of the value of the element. Compared with using a program to control the value adjustment of the data to be processed, the number of program modifications is reduced and the maintenance cost is reduced.
[0111] The present application also provides a data processing device, the structure of which is as follows: Figure 4 As shown, it may include: a receiving unit 10, a searching unit 20, a determining unit 30, a processing unit 40 and a sending unit 50.
[0112] The receiving unit 10 is used to receive the query conditions and input data sent by the caller; the query conditions are used to determine the data to be processed, and the input data is used to assist the assignment operation of the data to be processed. The input data includes the values of multiple fields, and the values of these fields are assigned on the caller side. When the caller reads the data to be processed from the database, the values of the fields in the input data are used to assist the assignment operation of the data to be processed. For example, one auxiliary method is to replace the values of the elements in the data to be processed with the values of the fields in the input data.
[0113] The search unit 20 is used to search for a target template identity that matches the query condition from multiple template identities based on the query condition; the target template identity that matches the query condition can be the target template identity pointed to by the query condition among the multiple template identities, that is, the query condition can uniquely point to a target template identity.
[0114] One feasible way to query the condition is to establish a correspondence between the query condition and the template identity. The way for the search unit 20 to search for the target template identity may be: based on the query condition, search for a target template information table matching the query condition from multiple template information tables; and extract the target template identity from the target template information table.
[0115] Optionally, the template information table includes a template identification field and a query field for querying the template information table; the template element information table includes a template identification field and a location field for locating the data to be processed; before receiving the query conditions and input data, the fields in the template information table and the template element information table are assigned values. Correspondingly, the search unit 20 compares the query fields in the multiple template information tables with the query conditions respectively to obtain the query fields that match the query conditions, and the template information table where the query fields that match the query conditions are located is the target template information table; the values of the template identification field in the target template element information table and the target template information table are the same.
[0116] The determination unit 30 is used to determine the data to be processed based on the template element information table that matches the target template identity identifier; the method of determining the data to be processed is as follows:
[0117] The determination unit 30 determines the data table pointed to by the value of the region field and / or the value of the category field in the template element information table matching the target template identity, and the data table is the data to be processed;
[0118] or
[0119] The determination unit 30 determines the area pointed to by the value of the area field based on the value of the area field in the template element information table that matches the target template identity, and the data in the area is the data to be processed.
[0120] The processing unit 40 is used to process the data to be processed based on the assignment condition of the data to be processed and the input data, wherein the assignment condition of the data to be processed is used to indicate whether to use the input data to adjust the value of the data to be processed. The processing methods include but are not limited to the following methods:
[0121] If the feature level of the element in the data to be processed is the first level, ignore the element; if the feature level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, adjust the value of the element to the value of the matching field; if there is no field matching the element in the input data, adjust the value of the element to a null value; if the feature level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, adjust the value of the element to the value of the matching field; if there is no field matching the element in the input data, adjust the value of the element to the default value; if the feature level of the element in the data to be processed is the fourth level, maintain the value of the element at the default value; if the feature level of the element in the data to be processed is the fifth level, adjust the value of the element to the value of the target field in the target data table.
[0122] Optionally, the target data table and the target field are determined based on a regular expression of the elements at the fifth level of the feature level.
[0123] The sending unit 50 is used to send the processed data to be processed to the caller.
[0124] It can be seen from the above technical solution that after the data to be processed is processed based on the assignment conditions of the data to be processed and the input data, the processed data to be processed is sent to the caller for use. Because the assignment conditions of the data to be processed can indicate whether to adjust the value of the data to be processed, if the value of the data to be processed can be adjusted based on the input data, it means that for all elements in the data to be processed, the values of some elements in the data to be processed can be adjusted, and the values of some elements in the data to be processed can remain unchanged.
[0125] When the data to be processed is updated (such as product updates or updates caused by iterating new products), the amplitude conditions of the elements in the data to be processed can also be modified to reduce the number of modifications to the program that implements the data processing method. In addition, the judgment of the data to be processed is mainly concentrated in the template element information table, which makes the program more concise, and the readability and scalability are greatly increased. Maintenance is also mainly concentrated on the maintenance of the template element information table. The maintenance cost of the template element information table is much lower than the maintenance cost of the program, so the maintenance cost can be reduced.
[0126] In addition, the present application provides an electronic device, which includes: one or more processors and a memory; wherein the memory is used to store one or more computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the above-mentioned data processing method.
[0127] The present application provides a computer storage medium, which includes computer instructions. When the computer instructions are executed on an electronic device, the electronic device executes the above-mentioned data processing method.
[0128] It should be noted that the various embodiments in this specification can be described in a progressive manner, and the features recorded in the various embodiments in this specification can be replaced or combined with each other. Each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0129] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0130] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
[0131] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Receive query conditions and input data sent by the caller; Based on the query condition, searching for a target template identity identifier that matches the query condition from multiple template identity identifiers; Determining data to be processed based on a template element information table that matches the target template identity identifier; Based on the assignment condition of the data to be processed and the input data, the data to be processed is processed, wherein the assignment condition of the data to be processed is used to indicate whether to adjust the value of the data to be processed using the input data; Sending the processed data to be processed to the caller; The processing of the data to be processed based on the assignment condition of the data to be processed and the input data includes: if the element level of the element in the data to be processed is the first level, ignoring the element; if the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, adjusting the value of the element to the value of the matching field, if there is no field matching the element in the input data, adjusting the value of the element to a null value; if the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, adjusting the value of the element to the value of the matching field, if there is no field matching the element in the input data, adjusting the value of the element to a default value; if the element level of the element in the data to be processed is the fourth level, maintaining the value of the element as the default value; if the element level of the element in the data to be processed is the fifth level, adjusting the value of the element to the value of the target field in the target data table.
2. The method according to claim 1, characterized in that The target data table and the target field are determined based on a regular expression of an element whose element level is the fifth level.
3. The method according to claim 1, characterized in that The step of searching, based on the query condition, a target template identity identifier that matches the query condition from a plurality of template identities comprises: Based on the query condition, a target template information table matching the query condition is found from multiple template information tables; and the target template identity is extracted from the target template information table.
4. The method according to claim 3, characterized in that The template information table includes a template identification field and a query field for querying the template information table; the template element information table includes a template identification field and a positioning field for locating the data to be processed; before receiving the query conditions and the input data, the fields in the template information table and the template element information table are assigned values.
5. The method according to claim 3 or 4, characterized in that: The searching, based on the query condition, from a plurality of template information tables to find a target template information table that matches the query condition comprises: Compare the query fields in the multiple template information tables with the query conditions respectively to obtain the query fields matching the query conditions, and the template information table where the query fields matching the query conditions are located is the target template information table; The values of the template identity fields in the target template element information table and the target template information table are the same.
6. The method according to claim 1, characterized in that The determining of the data to be processed based on the template element information table matching the target template identity identifier includes: Based on the value of the area field and / or the value of the category field in the template element information table matching the target template identity, determine the data table pointed to by the value of the area field and / or the value of the category field, the data table being the data to be processed; or Based on the value of the area field in the template element information table that matches the target template identity, the area pointed to by the value of the area field is determined, and the data located in the area is the data to be processed.
7. A data processing device, characterized in that: The device comprises: A receiving unit, used for receiving query conditions and input data sent by the caller; A searching unit, configured to search for a target template identity that matches the query condition from a plurality of template identities based on the query condition; A determination unit, configured to determine the data to be processed based on the template element information table matching the target template identity identifier; a processing unit, configured to process the data to be processed based on the assignment condition of the data to be processed and the input data, wherein the assignment condition of the data to be processed is used to indicate whether to adjust the value of the data to be processed using the input data; A sending unit, used for sending the processed data to be processed to the caller; The processing unit is used for ignoring the element if the element level of the element in the data to be processed is the first level; if the element level of the element in the data to be processed is the second level, if there is a field matching the element in the input data, adjusting the value of the element to the value of the matching field, and if there is no field matching the element in the input data, adjusting the value of the element to a null value; if the element level of the element in the data to be processed is the third level, if there is a field matching the element in the input data, adjusting the value of the element to the value of the matching field, and if there is no field matching the element in the input data, adjusting the value of the element to a default value; if the element level of the element in the data to be processed is the fourth level, maintaining the value of the element as the default value; if the element level of the element in the data to be processed is the fifth level, adjusting the value of the element to the value of the target field in the target data table.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors and a memory; wherein the memory is used to store one or more computer program codes, and the computer program codes include computer instructions. When the one or more processors execute the computer instructions, the electronic device executes the data processing method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Data query method and device and server
CN113051362A