Data Dynamic Processing Method, Device, Storage Medium and Device

By determining class variable information and business logic information in data processing, using preset rules and dynamic analysis technology, the problem of unknown data types in object-oriented data processing is solved, and flexible data processing and business logic execution is realized.

CN113626110BActive Publication Date: 2025-07-18BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202010390816.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-05-09
Publication Date
2025-07-18
Estimated Expiration
2040-05-09

AI Technical Summary

Technical Problem

In object-oriented data processing, the data cannot be placed into predefined variables because the data type cannot be determined, resulting in the failure of business logic processing and errors are easily reported.

Method used

When receiving the to-process data, determine the class variable information and business logic information of the preset processing function, use the preset rules to assign the class variable information, and perform data processing based on the business logic information, and use python's exec function and regular expression matching techniques to realize dynamic analysis and assignment.

Benefits of technology

It improves the flexibility of dynamic data processing, can process unknown data and realize business logic processing, avoids direct error reporting, and improves the efficiency and flexibility of data processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626110B_ABST
    Figure CN113626110B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of data dynamic processing, and discloses a data dynamic processing method, device, storage medium and apparatus. When receiving data to be processed, the present invention determines the class variable information and business logic information of a preset processing function; assigns values to the class variable information in the preset processing function according to the data to be processed through a preset rule to obtain the assigned class variable information; and performs data processing on the assigned class variable information according to the business logic information, so as to assign values to the data to be processed through the preset processing function, implement the business logic processing of the data to be processed, and achieve the purpose of improving the flexibility of data dynamic processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data dynamic processing, and in particular to a data dynamic processing method, device, storage medium and apparatus. Background Art

[0002] Currently, when performing business logic processing, it is necessary to put the data required by the business logic into pre-defined variables, and the business processing is achieved by obtaining the variables in the business logic and extracting the data in the variables;

[0003] However, in object-oriented data processing, since the data type cannot be known, the required data cannot be put into pre-defined variables. Therefore, in business logic processing, subsequent data processing cannot be achieved because the required variables cannot be found, which easily causes a direct error and leads to the inability to process the business logic. Summary of the Invention

[0004] The main object of the present invention is to provide a data dynamic processing method, device, storage medium and apparatus, aiming to solve the problem of how to improve the flexibility of data dynamic processing.

[0005] To achieve the above object, the present invention provides a data dynamic processing method, and the data dynamic processing method includes the following steps:

[0006] When receiving data to be processed, determine the class variable information and business logic information of a preset processing function;

[0007] Assign values to the class variable information in the preset processing function according to the data to be processed through a preset rule, and obtain the class variable information after assignment;

[0008] Perform data processing on the class variable information after assignment according to the business logic information.

[0009] Preferably, the step of determining the class variable information of the preset processing function when receiving the data to be processed includes:

[0010] When receiving the data to be processed, search for increment code information in the preset processing function;

[0011] Configure the increment code information through preset attribute information to obtain the class variable information of the preset processing function.

[0012] Preferably, the step of searching for increment code information in the preset processing function when receiving the data to be processed includes:

[0013] When receiving the data to be processed, match the increment code address information in the preset processing function through a preset regular expression;

[0014] Search for the value-added code information in the preset processing function according to the value-added code address information.

[0015] Preferably, the configuring the value-added code information through preset attribute information to obtain class variable information includes:

[0016] Obtain the quantity information of the configured class variable information;

[0017] Configure the value-added code information through the preset attribute information and the quantity information to obtain class variable information.

[0018] Preferably, the assigning values to the class variable information in the preset processing function according to the data to be processed through preset rules to obtain the class variable information after assignment includes:

[0019] Obtain the parsing rule, and match the string in the data to be processed according to the parsing rule and the attributes of the class variable information;

[0020] Obtain the target data of the data to be processed according to the string;

[0021] Assign values to the class variable information through the preset processing function and the target data according to preset rules to obtain the class variable information after assignment.

[0022] Preferably, the assigning values to the class variable information through the preset processing function and the target data according to preset rules to obtain the class variable information after assignment includes:

[0023] Call the storage function and the content append function;

[0024] Assign values to the class variable information through the storage function, the content append function, the preset processing function and the target data to obtain the class variable information after assignment.

[0025] Preferably, the class variable information includes variable name information and variable value information;

[0026] The assigning values to the class variable information through the storage function, the content append function, the preset processing function and the target data to obtain the class variable information after assignment includes:

[0027] Assign values to the variable name information and the variable value information respectively through the storage function, the content append function, the preset processing function and the target data to obtain the class variable information after assignment.

[0028] In addition, to achieve the above object, the present invention also proposes a data dynamic processing device, and the data dynamic processing device includes:

[0029] A determination module, configured to determine class variable information and business logic information of a preset processing function when receiving data to be processed;

[0030] An assignment module, configured to assign values to the class variable information in the preset processing function according to the data to be processed through a preset rule, so as to obtain the class variable information after assignment;

[0031] A processing module, configured to perform data processing on the class variable information after assignment according to the business logic information.

[0032] In addition, to achieve the above object, the present invention further provides a data dynamic processing device, characterized in that the data dynamic processing device includes: a memory, a processor, and a data dynamic processing program stored on the memory and running on the processor, and when the data dynamic processing program is executed by the processor, the steps of the data dynamic processing method as described above are implemented.

[0033] In addition, to achieve the above object, the present invention further provides a storage medium, on which a data dynamic processing program is stored, and when the data dynamic processing program is executed by a processor, the steps of the data dynamic processing method as described above are implemented.

[0034] The technical solution provided by the present invention determines class variable information and business logic information of a preset processing function when receiving data to be processed; assigns values to the class variable information in the preset processing function according to the data to be processed through a preset rule to obtain the class variable information after assignment; and performs data processing on the class variable information after assignment according to the business logic information, so as to assign values to the data to be processed through the preset processing function, implement the business logic processing of the data to be processed, and achieve the purpose of improving the flexibility of data dynamic processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 is a schematic structural diagram of a data dynamic processing device for a hardware operating environment related to an embodiment of the present invention;

[0036] Figure 2 is a schematic flowchart of the first embodiment of the data dynamic processing method of the present invention;

[0037] Figure 3 is a schematic flowchart of the second embodiment of the data dynamic processing method of the present invention;

[0038] Figure 4 is a schematic flowchart of the third embodiment of the data dynamic processing method of the present invention;

[0039] Figure 5 is a schematic block diagram of the first embodiment of the data dynamic processing device of the present invention.

[0040] The realization, functional features and advantages of the present invention will be further described with reference to the embodiments and the accompanying drawings. Detailed implementation manners

[0041] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0042] Refer to Figure 1 , Figure 1 , which is a schematic structural diagram of a data dynamic processing device for the hardware operating environment involved in the embodiment solution of the present invention.

[0043] As Figure 1 shown, the data dynamic processing device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display). Optionally, the user interface 1003 may further include a standard wired interface and a wireless interface, and the wired interface of the user interface 1003 may be a universal serial bus (USB) interface in the present invention. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM); it may also be a stable memory, for example, a non-volatile memory, specifically, a disk memory. Optionally, the memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0044] Those skilled in the art can understand that Figure 1 the structure shown in

[0045] As Figure 1 shown, in the memory 1005 as a computer storage medium, there may be included an operating system, a network communication module, a user interface module, and a data dynamic processing program.

[0046] In Figure 1In the data dynamic processing device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to peripheral devices; the data dynamic processing device calls the data dynamic processing program stored in the memory 1005 through the processor 1001 and executes the data dynamic processing method provided by the embodiments of the present invention.

[0047] Based on the above hardware structure, embodiments of the data dynamic processing method of the present invention are proposed.

[0048] Refer to Figure 2 , Figure 2 which is a schematic flowchart of the first embodiment of the data dynamic processing method of the present invention.

[0049] In the first embodiment, the data dynamic processing method includes the following steps:

[0050] Step S10: When receiving the data to be processed, determine the class variable information and business logic information of the preset processing function.

[0051] It should be noted that the execution subject of this embodiment is the data dynamic processing device, and it can also be other devices that can implement the same or similar functions. This embodiment does not limit this. In this embodiment, the data dynamic processing device is taken as an example for illustration.

[0052] It can be understood that in general, in the object-oriented data processing process, data is processed through a processing function, and the variable information in the processing function is pre-corresponded with the variables in the logical processing process, so as to realize the data processing of the business logic. For example, when processing the business logic of A + B, first, the variables in the processing function need to be set as A and B, and then the business processing of A + B is carried out through the business logic of "+", however, when facing the situation where the information of A or B cannot be obtained from the data, the logical processing cannot be carried out. For example, when obtaining the data that A is 2, since only the business logic of A = 2 can be processed, when facing the data that A is 2, the logic of A + B cannot be processed.

[0053] In this embodiment, the data to be processed is data whose actual content or logical relationship cannot be determined. The class variable information is preset in the preset processing function through Python, and the unrecognizable data is dynamically processed through the class variable information. Among them, the class variable information includes class variable information and corresponding variable value information, and may also include other parameter information. This embodiment does not limit this.

[0054] Step S20: Assign values to the class variable information in the preset processing function according to the data to be processed through a preset rule, and obtain the class variable information after assignment.

[0055] It should be noted that the preset rule is a pre-set assignment rule. For example, it can be assigned according to the consistency of file names or the consistency of attributes. This embodiment does not limit this. The preset rule is flexible and can be adjusted flexibly according to user needs to meet the business needs of different users. Before assigning values to the class variable information, it is necessary to parse the data to be processed through a parsing rule. The parsing rule can be to compare the data to be processed with a preset keyword and identify the actual meaning of the data to be processed according to the comparison result. For example, by parsing the data to be processed "A is 2" through the preset rule, the class variable name is obtained as A, the variable value is 2, and "is" is the logical relationship where the variable relationship is equal, thus realizing the parsing of the data to be processed.

[0056] In a specific implementation, the parsing rule can be obtained by configuring or calling an interface. The data to be processed is parsed through the parsing rule, and the parsing rule can also be flexibly adjusted according to business requirements. For example, by parsing the data to be processed "A is 2" through the parsing rule, the class variable name is obtained as A, the variable value is 2, and the variable relationship is an equal relationship. Through the parsed data to be processed, the class variable information and the variable value information are obtained, so that the class variable information in the preset processing function can be assigned values through the class variable information and the variable value information, and the assigned class variable information is obtained, that is, A is assigned to the class variable name in the processing function, and 2 is assigned to the class variable value in the processing function, thus realizing subsequent logical processing.

[0057] Step S30: Perform data processing on the assigned class variable information according to the business logic information.

[0058] In this embodiment, since the content of the data to be processed is uncertain and the content to be parsed is also uncertain, after determining the parsing content, without changing the code, the parsing result is integrated into the running program to achieve the effect of dynamically parsing data and dynamically applying it. After dynamic parsing through the parsing rule, through configuration or other interface programs, the parsing conditions are obtained, so that the result can be dynamically added to the class instance for use.

[0059] Through the above solution, this embodiment determines the class variable information and business logic information of the preset processing function when receiving the data to be processed; assigns values to the class variable information in the preset processing function according to the data to be processed through the preset rule to obtain the assigned class variable information; performs data processing on the assigned class variable information according to the business logic information, thereby assigning values to the data to be processed through the preset processing function, realizing the business logic processing of the data to be processed, and achieving the purpose of improving the flexibility of data dynamic processing.

[0060] Refer toFigure 3 , Figure 3 is a flowchart of the second embodiment of the data dynamic processing method of the present invention. Based on the above Figure 2 shown first embodiment, the second embodiment of the data dynamic processing method of the present invention is proposed.

[0061] In the second embodiment, the step S10 includes:

[0062] Step S101, when receiving the data to be processed, search for the value-added code information in the preset processing function.

[0063] It should be noted that when processing the data to be processed through the preset processing function, variable information needs to be reserved in the preset processing function, and the dynamic processing of the data to be processed with unknown content is realized through the reserved variable information.

[0064] In a specific implementation, by obtaining the code information of the preset processing function, writing the value-added code information in a preset area according to the code information, and configuring the class variable information by writing the value-added code information, so that the preset processing function has the ability of dynamic parsing and realizes dynamic data processing.

[0065] Step S102, configure the value-added code information through the preset attribute information to obtain the class variable information of the preset processing function.

[0066] In this embodiment, using the function of dynamically executing code in python, the preset processing function can be the exec function in python, and there may be other functions. This embodiment does not limit this. For example, exec‘xxx’ dynamically adds class variables to the class instance, and parses the data with the dynamically obtained rules, and assigns the result to the class instance, so as to achieve the purpose of dynamic parsing. In the traditional way, the program cannot process this new variable after running, because the variable name is not yet determined and is not defined in the class instance, and it will directly report an error. It is also impossible to define all variables in advance in the code.

[0067] Further, the step S101 includes:

[0068] When receiving the data to be processed, match the value-added code address information in the preset processing function through a preset regular expression; search for the value-added code information in the preset processing function according to the value-added code address information.

[0069] It should be noted that when the preset processing function is the exec function, the class variable is added by using the function of dynamically executing code through the method of matching with a preset regular expression. For example, by executing exec('self.'+specialvers+' = []'), the class variable information is added, and the class variable information can also be added by executing other functions. This embodiment does not limit this.

[0070] Further, step S102 includes:

[0071] Obtain the quantity information of the configuration class variable information; configure the value-added code information through the preset attribute information and the quantity information to obtain the class variable information.

[0072] In a specific implementation, the processing limit of the preset processing function can also be increased by increasing the quantity information of the class variable information, that is, the preset processing function can process more data.

[0073] Through the above solution, in this embodiment, by obtaining the code information of the preset processing function, writing the value-added code information in the preset area according to the code information, and configuring the class variable information by writing the value-added code information, the preset processing function has the ability of dynamic parsing, realizing dynamic data processing.

[0074] Refer to Figure 4 , Figure 4 FIG. is a schematic flowchart of the third embodiment of the data dynamic processing method of the present invention. Based on the first embodiment or the second embodiment, the third embodiment of the data dynamic processing method of the present invention is proposed. In this embodiment, the description is made based on the first embodiment.

[0075] In the third embodiment, step S20 includes:

[0076] Step S201, obtain the parsing rule, and match the string in the data to be processed according to the parsing rule and the attribute of the class variable information.

[0077] It should be noted that the parsing rule pre-exists in the template, and the current parsing rule information is obtained by calling the information in the template. For example, it is implemented by the code m = re.findall(re_str, self.check_module[i]).

[0078] Step S202, obtain the target data of the data to be processed according to the string.

[0079] In a specific implementation, in order to match the strings in the data to be processed according to the parsing rules and the attributes of the class variable information; obtain the target data of the data to be processed according to the strings. For example, for the data to be processed "Li Si is 2", through parsing according to the parsing rules, it can be obtained that "Li Si" is the variable name, "2" is the variable value, and "is" represents the logical relationship of equality, so as to realize the parsing of the data to be processed.

[0080] Step S203, assign values to the class variable information according to the preset rules through the preset processing function and the target data, and obtain the class variable information after assignment.

[0081] Further, the step S203 includes:

[0082] Call the preset processing function and the content appending function.

[0083] It should be noted that the content appending function can be the append function, or other functions that can achieve value assignment. This embodiment does not limit this. In this embodiment, the append function is used as an example for illustration.

[0084] Assign values to the class variable information through the storage function, the content appending function, the preset processing function and the target data, and obtain the class variable information after assignment.

[0085] In a specific implementation, parse the data according to the rules and dynamically assign the result to the newly added class variable, m = re.findall(re_str, self.check_module[i]), where re.findall represents finding the parsing rules, and realize the assignment of the class variable information through the code exec'self.'+ specialvers + '.append(m_i), that is, assign values to the class variable information through the preset processing function, the content appending function and the target data, and obtain the class variable information after assignment.

[0086] Further, the variable information includes variable name information and variable value information.

[0087] The assignment of values to the class variable information through the storage function, the content appending function, the preset processing function and the target data, and obtaining the class variable information after assignment includes:

[0088] Assign values to the variable name information and the variable value information respectively through the storage function, the content appending function, the preset processing function and the target data, and obtain the class variable information after assignment.

[0089] It can be understood that since the variable information includes variable name information and variable value information, when assigning values to the variable information, in order to ensure the correctness of the assignment, it is necessary to assign values to the variable name information and the variable value information separately, that is, assign the parsed name to the variable name information and the parsed parameter value to the variable value information.

[0090] In a specific implementation, obtain the target name information and the corresponding target value information in the target data; assign values to the variable name information through the storage function, the content append function, the preset processing function, and the target name information to obtain the assigned variable name information; assign values to the variable value information through the storage function, the content append function, the preset processing function, and the target value information to obtain the assigned variable value information; use the assigned variable name information and the assigned variable value information as the assigned class variable information. For example, the variable function information includes A and B, where A represents the variable name information, B represents the variable value information, and the parsed information is that the name Li Si is equal to 2, then assign Li Si to A and 2 to B, thereby realizing the assignment of variable information and facilitating subsequent logical processing.

[0091] Further, the step S10 includes:

[0092] When receiving the data to be processed, call the preset processing function; obtain the class variable information and the business logic information in the class instance through the preset processing function.

[0093] It should be noted that when processing the data to be processed, the preset processing function can be added in the current processing code, so as to realize the processing of the data to be processed through the added preset processing function. In order to improve the efficiency of data processing, instead of adding the preset processing function, it is called in a way to call the existing preset processing function, and obtain the class variable information and the business logic information in the class instance through the preset processing function, so as to achieve the purpose of improving the data processing efficiency.

[0094] Further, before the step S10, the method further includes:

[0095] Obtain the class variable information adjustment instruction; extract the attribute parameter information in the class variable information adjustment instruction, and adjust the class variable information according to the attribute parameter information to obtain the adjusted class variable information.

[0096] It should be noted that the class variable information can be flexibly adjusted by obtaining the class variable information adjustment instruction.

[0097] Correspondingly, the step S10 includes:

[0098] When receiving data to be processed, determine the adjusted class variable information in the preset processing function.

[0099] Further, step S30 includes:

[0100] Extract the target variable information from the assigned class variable information according to the service logic information; perform data processing through the target variable information.

[0101] It can be understood that according to business requirements, the dynamically added class variables can be processed dynamically through the code def setSpecialType(self,specialtype).

[0102] In a specific implementation, when processing a batch of data, since the content of the data cannot be determined in advance, useful data needs to be parsed from these data for subsequent calculations. The useful data format cannot be determined before the program runs and needs to be processed dynamically. For example, perform dynamic parsing on the data (%ver%>="11.0.0.1001"), and use the dynamic parsing mechanism to achieve: pass the parsing rule and the dynamically added variable into the mechanism processing function. It can also be done through configuration or interface call. The code implementation is as follows:

[0103] re_str=r'(%ver%)(.{1,2})"(.+?)"\)([&|]{1,2})?'

[0104] self.setSpecialVer(re_str,"safevers")

[0105] After being processed by setSpecialVer, the class instance already has the safevers variable. Next, the business logic of safevers can be directly processed. Compared with the traditional method, this safevers variable cannot be processed because there is no safevers in the class instance, which will directly report an error, and it is also impossible to define all variables in advance in the code.

[0106] Further, the extracting the target variable information from the assigned class variable information according to the service logic information includes:

[0107] Obtain the service logic information, and determine whether there is the attribute information of the assigned class variable information in the service logic information; obtain the service logic information with the attribute information of the assigned class variable information; extract the target variable information from the assigned class variable information through the service logic information with the attribute information of the assigned class variable information.

[0108] It should be noted that when processing business logic, since the parameters of the business logic need to be stored in variables, the business logic can be processed only when the parameter information is stored, and no processing will be performed when the parameter information is not stored, thereby improving the efficiency of business processing.

[0109] In this embodiment, through the above scheme, the class variable information is assigned by using a preset processing function, a content appending function, and target data to obtain the assigned class variable information, so that the parameter and the corresponding parameter value information for business logic processing are stored in the variable information, realizing the dynamic processing of business logic.

[0110] In addition, an embodiment of the present invention further provides a storage medium, on which a data dynamic processing program is stored. When the data dynamic processing program is executed by a processor, the steps of the terminal network access method described above are implemented.

[0111] Since this storage medium adopts all the technical solutions of all the above embodiments, it has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be elaborated here one by one.

[0112] In addition, with reference to Figure 5 , an embodiment of the present invention further provides a data dynamic processing device, which includes:

[0113] A determination module 10, configured to determine the class variable information and business logic information of a preset processing function when receiving data to be processed.

[0114] It should be noted that the execution subject of this embodiment is a data dynamic processing device, and it can also be other devices that can implement the same or similar functions. This embodiment does not make any restrictions in this regard. In this embodiment, the data dynamic processing device is taken as an example for description.

[0115] It can be understood that in general, in the object-oriented data processing process, data is processed through a processing function, and the variable information in the processing function is pre-corresponded with the variables in the logic processing process, so as to realize the data processing of business logic. For example, when processing the business logic of A + B, first, the variables in the processing function need to be set as A and B, and then the business processing of A + B is performed through the business logic of "+", but when it is impossible to obtain the information of A or B from the data, the logic processing cannot be performed. For example, when obtaining the data that A is 2, since only the business logic of A = 2 will be processed, when facing the data that A is 2, the logic of A + B cannot be processed.

[0116] In this embodiment, the data to be processed is data for which the actual content or logical relationship of the data cannot be determined. Python is used to pre-set class variable information in a preset processing function, and the unrecognized data is dynamically processed through the class variable information. The class variable information includes class variable information and corresponding variable value information, and may also include other parameter information, which is not limited in this embodiment.

[0117] An assignment module 20 is configured to assign values to the class variable information in the preset processing function according to the data to be processed through a preset rule, so as to obtain the class variable information after assignment.

[0118] It should be noted that the preset rule is a pre-set assignment rule. For example, assignment is performed according to the consistency of file names or according to the consistency of attributes. This is not limited in this embodiment. The preset rule is flexible and can be flexibly adjusted according to user needs to meet the business needs of different users. Before assigning values to the class variable information, it is necessary to parse the data to be processed through a parsing rule. The parsing rule can be to compare the data to be processed with a preset keyword, and identify the actual meaning of the data to be processed according to the comparison result. For example, by parsing the data to be processed "A is 2" through a preset rule, the class variable name is obtained as A, the variable value is 2, and "is" is a logical relationship where the variable relationship is equal, so as to realize the parsing of the data to be processed.

[0119] In a specific implementation, the parsing rule can be obtained by configuring or calling an interface. The data to be processed is parsed through the parsing rule, and the parsing rule can also be flexibly adjusted according to business needs. For example, by parsing the data to be processed "A is 2" through the parsing rule, the class variable name is obtained as A, the variable value is 2, and the variable relationship is an equal relationship. Through the parsed data to be processed, the class variable information and the variable value information are obtained, so that the class variable information in the preset processing function can be assigned values through the class variable information and the variable value information, and the class variable information after assignment is obtained, that is, A is assigned to the class variable name in the processing function, and 2 is assigned to the class variable value in the processing function, so as to realize subsequent logical processing.

[0120] A processing module 30 is configured to perform data processing on the class variable information after assignment according to the business logic information.

[0121] In this embodiment, since the content of the data to be processed is uncertain and the content to be parsed is also uncertain, after determining the parsing content, without changing the code, the parsing result is incorporated into the running program to achieve the effect of dynamically parsing data and dynamically applying it. After dynamic parsing through the parsing rule, the parsing conditions are obtained through configuration or other interface programs, so that the result can be dynamically added to the class instance for use.

[0122] In this embodiment, through the above solution, when receiving the data to be processed, the class variable information and business logic information of the preset processing function are determined; according to the data to be processed, the class variable information in the preset processing function is assigned values through preset rules to obtain the assigned class variable information; and according to the business logic information, data processing is performed on the assigned class variable information, so as to assign values to the data to be processed through the preset processing function, implement the business logic processing of the data to be processed, and achieve the purpose of improving the flexibility of data dynamic processing.

[0123] Further, the determining module is further configured to, when receiving the data to be processed, search for the value-added code information in the preset processing function;

[0124] Configure the value-added code information through preset attribute information to obtain the class variable information of the preset processing function.

[0125] Further, the determining module is further configured to, when receiving the data to be processed, match the value-added code address information in the preset processing function through a preset regular expression;

[0126] Search for the value-added code information in the preset processing function according to the value-added code address information.

[0127] Further, the determining module is further configured to obtain the quantity information of the configured class variable information;

[0128] Configure the value-added code information through preset attribute information and the quantity information to obtain the class variable information.

[0129] Further, the assigning module is further configured to obtain a parsing rule, and match the string in the data to be processed according to the parsing rule and the attributes of the class variable information;

[0130] Obtain the target data of the data to be processed according to the string;

[0131] Assign values to the class variable information through the preset processing function and the target data according to preset rules to obtain the assigned class variable information.

[0132] Further, the assigning module is further configured to call a storage function and a content appending function;

[0133] Assign values to the class variable information through the storage function, the content appending function, the preset processing function and the target data to obtain the assigned class variable information.

[0134] The data dynamic processing device described in the present invention adopts all the technical solutions of all the above embodiments, and thus has at least all the beneficial effects brought by the technical solutions of the above embodiments, which will not be elaborated one by one here.

[0135] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.

Claims

1. A method for dynamically processing data, characterized in that, The data dynamic processing method includes the following steps: When receiving data to be processed, determine the class variable information and business logic information of a preset processing function; According to the data to be processed, assign values to the class variable information in the preset processing function through preset rules to obtain the assigned class variable information; Perform data processing on the assigned class variable information according to the business logic information; When receiving data to be processed, determining the class variable information of a preset processing function includes: When receiving data to be processed, search for value-added code information in the preset processing function; Configure the value-added code information through preset attribute information to obtain the class variable information of the preset processing function; The class variable information includes variable name information and variable value information; the step of assigning values to the class variable information in the preset processing function according to the data to be processed through preset rules to obtain the assigned class variable information includes: Obtain a parsing rule, and match the strings in the data to be processed according to the parsing rule and the attributes of the class variable information; Obtain the target data of the data to be processed according to the strings; Call a storage function and a content appending function; Assign values to the variable name information and variable value information respectively through the storage function, content appending function, preset processing function, and the target data to obtain the assigned class variable information.

2. The data dynamic processing method according to claim 1, characterized in that When receiving data to be processed, searching for value-added code information in the preset processing function includes: When receiving data to be processed, match the value-added code address information in the preset processing function through a preset regular expression; Search for the value-added code information in the preset processing function according to the value-added code address information.

3. The data dynamic processing method according to claim 1, characterized in that The step of configuring the value-added code information through preset attribute information to obtain class variable information includes: Obtain the quantity information of configuring class variable information; Configure the value-added code information through preset attribute information and the quantity information to obtain class variable information.

4. The data dynamic processing method according to claim 1, wherein The step of assigning values to the variable name information and variable value information respectively through the storage function, content appending function, preset processing function, and the target data to obtain the assigned class variable information includes: Obtain the target name information and corresponding target value information in the target data; Assign values to the variable name information through the storage function, content appending function, preset processing function, and the target name information to obtain the assigned variable name information; Assign values to the variable value information through the storage function, content appending function, preset processing function, and the target value information to obtain the assigned variable value information; Use the assigned variable name information and assigned variable value information as the assigned class variable information.

5. The data dynamic processing method according to any one of claims 1 to 4, characterized in that When receiving data to be processed, determining the class variable information and business logic information of a preset processing function includes: When receiving data to be processed, call a preset processing function; Obtain the class variable information and business logic information in the class instance through the preset processing function.

6. The data dynamic processing method according to any one of claims 1 to 4, characterized in that Before determining the class variable information of the preset processing function when receiving data to be processed, the method further includes: Class variable information acquisition and adjustment instruction; Extract the attribute parameter information in the class variable information adjustment instruction, and adjust the class variable information according to the attribute parameter information to obtain the adjusted class variable information; Correspondingly, when receiving the data to be processed, determining the class variable information of the preset processing function includes: When receiving the data to be processed, determine the adjusted class variable information in the preset processing function.

7. The data dynamic processing method according to any one of claims 1 to 4, characterized in that The data processing of the assigned class variable information according to the service logic information includes: Extract the target variable information in the assigned class variable information according to the service logic information; Perform data processing through the target variable information.

8. The data dynamic processing method according to claim 7, characterized in that, The extraction of the target variable information in the assigned class variable information according to the service logic information includes: Determine whether the attribute information of the assigned class variable information exists in the service logic information; Obtain the service logic information storing the attribute information of the assigned class variable information; Extract the target variable information in the assigned class variable information through the service logic information storing the attribute information of the assigned class variable information.

9. A data dynamic processing device, characterized in that, The data dynamic processing device includes: A determination module, configured to determine the class variable information and service logic information of the preset processing function when receiving the data to be processed; An assignment module, configured to assign the class variable information in the preset processing function according to the data to be processed through a preset rule to obtain the assigned class variable information; A processing module, configured to perform data processing on the assigned class variable information according to the service logic information; The determination module is further configured to search for the incremental code information in the preset processing function when receiving the data to be processed; Configure the incremental code information through preset attribute information to obtain the class variable information of the preset processing function; The class variable information includes variable name information and variable value information; the assignment module is further configured to obtain a parsing rule, match the string in the data to be processed according to the parsing rule and the attributes of the class variable information; obtain the target data of the data to be processed according to the string; call a storage function and a content append function; assign values to the variable name information and variable value information respectively through the storage function, content append function, preset processing function and the target data to obtain the assigned class variable information.

10. The data dynamic processing device according to claim 9, characterized in that, The determination module is further configured to match the incremental code address information in the preset processing function through a preset regular expression when receiving the data to be processed; Search for the incremental code information in the preset processing function according to the incremental code address information.

11. The data dynamic processing device according to claim 9, wherein The determination module is further configured to obtain the quantity information of the configured class variable information; Configure the incremental code information through preset attribute information and the quantity information to obtain the class variable information.

12. A data dynamic processing device, characterized in that, The data dynamic processing device includes: a memory, a processor, and a data dynamic processing program stored on the memory and running on the processor. When the data dynamic processing program is executed by the processor, the steps of the data dynamic processing method according to any one of claims 1 to 8 are implemented.

13. A storage medium, characterized in that, A data dynamic processing program is stored on the storage medium, and when the data dynamic processing program is executed by a processor, the steps of the data dynamic processing method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Dynamic language variable recognition method and device, translation method and software transplantation method

    CN107179933A