Detailed Description
In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
FIG. 1 is a flow chart of a method of one embodiment of a method for processing a configuration data structure as described herein. Although the present application provides method operational steps or apparatus configurations as illustrated in the following examples or figures, more or fewer operational steps or module configurations may be included in the method or apparatus based on conventional or non-inventive efforts. In the case of steps or structures where there is no logically necessary cause-and-effect relationship, the execution order of the steps or the block structure of the apparatus is not limited to the execution order or the block structure provided in the embodiments of the present application. The described methods or modular structures, as applied to a device or end product in practice, may be executed sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) in accordance with the embodiments or with the modular structures illustrated in the figures.
Specifically, as shown in fig. 1, a method for processing a configuration data structure according to an embodiment of the present application may include:
s1: and acquiring source data to be processed, and loading a preset data configuration file matched with the service scene of the source data.
The source data described in the present application may generally include data in a data source that needs to perform data visualization to generate a chart in a specific application scenario. Generally, when a data visualization job task is received, source data to be processed can be determined, and a data source of the job task is set.
Further, after the source data to be processed is obtained, a corresponding data configuration file may be loaded according to the service scenario of the source data of the data visualization job task, and in this embodiment, the data configuration file may be loaded specifically by loading a data modeling tool. In the application, a general data configuration file of a service scene under a job task can be preset, and the data configuration file can be suitable for configuring data structures of different job tasks belonging to the same service scene. Generally, in the data visualization process, some common visual elements are usually included, such as:
(1) coordinates are as follows: the position of the numerical value is corresponded to a rectangular coordinate system or a polar coordinate system;
(2) size: the magnitude of the numerical value is corresponded to the magnitude of the figure;
(3) color: the classification and the limit of the numerical value and the like are corresponding to the difference of the color;
(4) labeling: the characteristics of the values are marked with labels;
(5) and (3) association: the association between the values is connected by the association line.
When drawing a graph, mapping of data to the graph is performed, that is, mapping of a measure of a data value in source data, mapping of a data attribute, and the like. Data in a data visualization job task can be viewed as a collection of data objects and attributes of the data objects. In the application, the attributes of the set data and the types and formats of the attribute values can be predefined for different service scenes, and a general data configuration file suitable for a specific certain type of service scenes is formed.
In this embodiment of the application, the data structure may include an attribute and an attribute value of the data, where the attribute may specifically include a variable, a value range, a feature, a characteristic, or the like of the data, and the attribute value may be understood as a data value that specifically expresses a numerical value or a symbol of the data. In most real-world applications, the type and format of data is typically fixed for each data in a particular business scenario. For example, in the drawing of web page charts of financial services, system security, service orders and the like, a large number of the same or similar configuration modes often exist for data definition, value taking, calling modes and the like related to the same service scene. Therefore, in the embodiment of the application, a data configuration file adaptive to a specific service scene can be predefined and set, and the data configuration file can be loaded through a provided general configuration tool in the implementation process, so that a user can avoid defining the same data configuration for each chart, the redundancy of codes is reduced, and the coding efficiency is improved.
Specifically, in the application scenario of the webpage data visual rendering page diagram, the data configuration file may adopt a JSON-described file format, and the data structure configuration information of the service scenario predefined by the user is stored in the JSON data description format. The json (javascript Object notification) is a lightweight data exchange format, adopts a text format completely independent of a language, is an ideal data exchange language, is easy to read and write by a human, and is also easy to parse and generate by a machine (generally used for increasing a network transmission rate). The written format of JSON data is typically: name/value pairs. Specifically, the configuration content in a configuration file provided by the application scenario of the present embodiment in the JSON format may include: PropertyName represents the attribute name of the data, as the key of the data structure, for pairing, name represents the display name of the data (for display on a chart), type represents the type of the data, and format defines the formatting information of the data (e.g., display the decimal point, how the time type data should be displayed, etc.). Code implementations can include the following data structure configuration information:
the user may preset a data profile for a certain class of service scenarios. Therefore, when processing different job tasks in the service scene, the user can load the data configuration file of the service scene to complete the data definition of the source data. The data configuration file contains data structure configuration information of all data which can be used in a service scene defined by a user. When the method is used, the preset data configuration file matched with the source data service scene can be loaded according to the requirement after the source data to be processed is obtained.
S2: and searching a second matching field matched with the first matching field of the source data in the data configuration file.
The source data described in this embodiment may generally perform normalization processing on the data attribute name and the attribute in the data configuration file before loading the data, and unify the set attribute name of the source data in the data source and the attribute name expressing the same meaning in the data configuration file. Thus, the provided data modeling tool can search the loaded data configuration file for the pairing according to the attribute name. In the application scenario of this embodiment, the search configuration may be set according to an attribute name, that is, in this embodiment, both the first matching field of the source data and the second matching field of the data configuration file that are paired in the search are data attribute names. Of course, in other embodiments, the first matching field and the second matching field may also be other data fields configured for finding a pair. Or, even in some embodiments, the first matching field and the second matching field may not be the same data field, but the matching is searched through the corresponding relationship between the first matching field and the second matching field. Therefore, in another embodiment of the processing method for configuring a data structure according to the present application, the first matching field and the second matching field may be attribute names of data.
In a specific application, for example, when a data visualization job task of a financial business scenario is processed, a data configuration file "FinCfgUtil" in JSON format suitable for the financial business scenario is configured in advance. The data configuration file "FinCfgUtil" defines attributes and types of attribute values of 100 data that can be used in a financial service scene in advance, and includes data structure configuration information of attribute names, data types, value-taking modes, and the like. When data is modeled (defined) in actual financial development, the source data in the data source of the loading setting actually uses 30 data, and the attribute names of the 30 source data can be uniformly normalized to be the same as the attribute names of the data expressing the same meaning in the data configuration file before the loading processing. Then, the same attribute name (second matching field) as the attribute name (first matching field) of the source data can be searched one by one in the data profile "FinCfgUtil" according to the attribute name.
In this embodiment, after the source data is acquired and the corresponding data configuration file is loaded, a second matching field matched with the first matching field of the source data may be searched in the data configuration file.
S3: and assigning the data structure configuration information of the second matching field in the searched data configuration file to the corresponding first matching field in the source data.
As described above, through searching and matching in the data configuration file, the second matching field matched with the first matching field in the data configuration file can be found, and then the data structure configuration information of the found second matching field can be assigned to the corresponding first matching field in the source data, so as to generate the final data definition, and complete the data structure configuration. In the application scenario of the embodiment, a series of operations such as loading, searching, pairing, assigning, generating data definition and the like of the data configuration file can be completed by executing and processing inside through a set data modeling tool, so that data definition of source data is automatically realized, and the work processing efficiency is greatly improved.
For example, corresponding data structure configuration information of 30 source data is found in all the data configuration files "FinCfgUtil" in JSON format applicable to the financial service scene, the data structure configuration information under 30 attribute names which are the same as the attribute names of the source data in the data configuration files can be assigned to the 30 source data, and code definitions, values, calling modes and the like of the 30 source data can be generated quickly and automatically.
Of course, in some application scenarios, the data configuration file may not necessarily include all data fields of the source data under the current job task, for example, the data configuration file "FinCfgUtil" may include only data structure configuration information of 29 source data of 30 source data, and there is no relevant data structure configuration information for the attribute name "AntFanyi". The data structure configuration for the source data having the attribute name "AntFanyi" at this time can be set by the user himself using manual encoding. Of course, the user may also add configuration information defined by the related data of the attribute name "AntFanyi" in the data configuration file "FinCfgUtil", and then reload the data configuration file "FinCfgUtil", thereby completing the data structure configuration of all source data including the attribute name "AntFanyi".
Therefore, by adopting the implementation scheme provided by the embodiment of the application, when data is visualized to perform data modeling processing, rapid and automatic data definition (data modeling) can be realized by loading the set data configuration tool, repeated data configuration of different operation tasks under the same service scene is reduced, code redundancy is greatly reduced, and the operation efficiency is improved. For example, the execution code for the web page charting data visualization process setting may be as follows:
var dataFrame ═ new Frame (data); // conversion of raw data to data set
dataFrame ═ frame, rename ('original', 'new'); // Uniform Attribute name
var FinCfgUtil ═ require ('FinCfgUtil'); // load data configuration tool
Source (dataFrame, FinCfgUtil); generating final data definition and loading it as data source into chart object
The user only needs to input the unified data configuration tool as a second parameter when the user loads data (namely, the data source is loaded in the chart instance) at chat. Compared with the mode in the prior art, the type, the format and the like of each attribute of the data do not need to be defined once, and a new model can be generated for all data needing to be redefined once, so that the development efficiency is greatly improved, the code quantity and the configuration items of drawing the chart are reduced, the codes are clear and easy to read, the maintenance is realized, and the whole job task processing efficiency and the user job operation experience are provided.
The processing method for configuring the data structure provided by the application can be applied to data model construction for performing visualization processing on webpage chart drawing, and correspondingly, in the application scenario, the source data in one implementation mode of the source data can include: graph data in data visualization processing in a web page graph drawing job. Of course, it should be noted that the processing method of the configuration data structure provided by the present application is not limited to related operations drawn by a webpage diagram, and in other application scenarios, such as terminal application presentation interface design, information interaction interface design, and the like, a technical solution provided by the processing method can be used to implement rapid and automatic generation of data definitions for source data in an operation task according to a pre-configured general data configuration file based on a service scenario.
In an embodiment of the application, the data configuration file may be described in a JSON format, and particularly in a service scene of a web page graph drawing job, JSON provides a general data interaction format, so that a processor is easy to parse and generate, and the overall processing efficiency of the web page graph drawing job can be improved. Therefore, in an embodiment of the processing method for configuring a data structure according to the present application, the data configuration file is set to adopt a json (javascript Object notification) data description format. Of course, the present application is not limited to the data configuration file being described in the JSON data format, and other data description formats may be adopted in other alternative embodiments.
As mentioned above, the user may preset a data profile for a certain type of service scenario. Therefore, when processing different job tasks in the service scene, the user can load the data configuration file of the service scene to complete the data definition of the source data. Of course, the user may generate a corresponding data configuration file for each of different service scenarios according to analysis, demand design, and the like of the different service scenarios. When a user faces different service scenes, the data configuration file under the corresponding service scene can be loaded, and then the data definition of the source data can be completed. Therefore, in another embodiment of the present application, the data configuration file is configured to include structural configuration information of data defined based on a service scenario.
The data configuration tool under the scene can be provided for each service scene, repeated and low-efficiency data configuration work of a user is reduced, data display formats on charts under the same service scene can be unified, code redundancy is greatly reduced, the risk of coding operation errors is reduced, the scene adaptation is flexible, codes are clear and easy to read, the maintenance is convenient, and the coding efficiency is greatly improved.
The above-mentioned processing method of the configuration data structure can be implemented by adopting a page or a terminal application programming design language in combination with a necessary processor and a necessary memory. For example, when the web page chart drawing is used for data definition of source data, a data configuration tool can be generated by adopting Javascript language, the data configuration tool is additionally arranged to realize the rapid data definition of the source data and the field completion, and the processing efficiency of data visualization coding operation is improved. Therefore, based on the method for processing the configuration data structure, the present application provides a processing apparatus for configuring a data structure. Fig. 2 is a schematic block diagram of an embodiment of a configuration data structure processing apparatus provided in the present application. As shown in fig. 2, the apparatus in this embodiment may include:
the data loading module 101 may be configured to acquire source data to be processed and load a data configuration file matched with the source data service scenario;
the configuration matching module 102 may be configured to store a preset data configuration file defined based on a service scenario, and search a second matching field matched with the first matching field of the source data in the data configuration file matched with the source data service scenario;
the data configuration module 103 may be configured to assign the data structure configuration information of the second matching field in the searched data configuration file to the corresponding first matching field in the source data.
In some embodiments, the configuration matching module 102 may store a data configuration file in a current service scenario, and when processing a data visualization job task in the service scenario, the data configuration file may be used to implement a fast and automatic generation of a final data definition of source data. Of course, in another embodiment of the apparatus described in the present application, the configuration matching module 102 may provide a data configuration file in each service scenario based on different service scenarios, so as to further improve an applicable scenario range of the processing apparatus configured with a data structure, so that data visualization operation processing is more flexible and boundary. Therefore, in another embodiment of the apparatus of the present application, the data configuration file stored by the configuration matching module 102 may include:
at least one data profile is stored, the data profile being arranged to configure information based on a data structure of a service scenario definition.
The processing method for the configuration data structure is further used for business scenes of various data visualization processing such as application interfaces and drawing of web page diagrams. Especially in the drawing operation of the graph of the web page, the repeated and inefficient data setting work of a user can be greatly reduced, the data display format on the graph displayed on the web page can be unified, and the coding operation efficiency and the display efficiency are improved. Therefore, in an embodiment of the apparatus of the present application, the acquired source data to be processed may include chart data in a data visualization process in a web page chart drawing job.
Correspondingly, in the application scene of the drawing operation of the web page diagram, the stored data configuration file can be in a JSON data format, and the data can be searched according to the attribute name of the data when the data is searched and matched. Therefore, in another embodiment of the present application, the configuration matching module 102 stores a preset data configuration file configured to be described in JSON data format. And, in another optional implementation, the first matching field and the second matching field are attribute names of data. Specifically, the data configuration file described in the JSON data format and the description for searching for a match according to the attribute name may refer to the description related to the foregoing method, which is not described herein again.
By adopting the processing method and device for configuring the data structure, data definition in source data can be completed quickly, data structure configuration can be completed through direct loading when the device is used, repeated work of configuring the data structure by a user is reduced, and coding operation efficiency is improved greatly. And the data of the same type of service scene can adopt a unified data configuration file, and unified and standardized data definition is used, so that code redundancy is greatly reduced, the risk of code errors is reduced, and the operation experience of a user and the processing efficiency of the whole operation task are improved.
Of course, based on the description of the embodiments of the method and the apparatus for processing a configuration data structure provided in the present application, a data configuration tool may also be separately generated to perform data configuration on data of a job task in a certain service scenario, including but not limited to data definition for performing data visualization on chart data. In some terminal application design coding operations, the data configuration described in the present application can also be used to complete automatic and fast data structure configuration. Therefore, the present application further provides a data structure configuration apparatus, which may be formed by using a programming language such as Javascript in combination with necessary hardware, and specifically, the data structure configuration apparatus may include:
the storage unit 201 may be configured to store at least one preset data configuration file defined based on a service scenario;
the processing unit 202 may be configured to search, in a data configuration file matched with a source data service scenario to be processed, a second matching field matched with the first matching field of the source data, and assign data structure configuration information of the searched second matching field to a corresponding first matching field in the source data.
Fig. 3 is a schematic block diagram of an embodiment of a data result configuration apparatus provided in the present application. The data structure configuration device provided by the embodiment of the application can be in the form of data configuration tool components, modules, third-party applications and the like which can be loaded in a data modeling tool or coding operation, can be flexibly applied to various service scenes, greatly reduces repeated data configuration in a data model, has clear and readable codes, is convenient to maintain, and improves the operation processing efficiency.
Although the present application refers to the data configuration file in JSON data format, the data format of propertylame attribute name shown in the embodiment, the data format setting such as searching and matching by attribute name, drawing web page diagram, javascript language, etc., the information interaction mode, the application scenario, and the description of the programming design language, the present application is not limited to the case that the data configuration file completely conforms to the standard design language, the information interaction, or the description of the embodiment. The implementation of some design languages, application scenarios, information interactions, or embodiments described in the embodiments may be modified slightly to implement the same, equivalent, similar, or expected implementation results after modification. Of course, even if the data processing and determining manners such as javascript language or attribute name matching and searching are not adopted, the same application can be still implemented as long as the data definition, information interaction, and information determination feedback manners of the embodiments described above are met, and further description is omitted here.
Although the present application provides method steps as described in an embodiment or flowchart, more or fewer steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one manner of performing the steps in a multitude of orders and does not represent the only order of execution. When an actual apparatus or client product executes, it may execute sequentially or in parallel (e.g., in the context of parallel processors or multi-threaded processing) according to the embodiments or methods shown in the figures.
The units, devices or modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. For convenience of description, the above devices are described as being divided into various modules by functions, and are described separately. Of course, in implementing the present application, the functions of each module may be implemented in one or more software and/or hardware, or a module implementing the same function may be implemented by a combination of a plurality of sub-modules or sub-units, and the like.
Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may therefore be considered as a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, classes, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, or the like, and includes several instructions for enabling a computer device (which may be a personal computer, a mobile terminal, a server, or a network device) to execute the method according to the embodiments or some parts of the embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same or similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like.
While the present application has been described with examples, those of ordinary skill in the art will appreciate that there are numerous variations and permutations of the present application without departing from the spirit of the application, and it is intended that the appended claims encompass such variations and permutations without departing from the spirit of the application.