Background
In recent years, large screen visual configuration technology has rapidly developed. In the traditional large screen configuration process, a rear-end service interface needs to be docked, and in the docking process, the rear-end service interface needs to be matched with a large screen visual chart plug-in. The back-end service needs to carry out a large amount of adaptation programming in the adaptation process, so that the workload of back-end service coding is increased to a certain extent, the working efficiency is reduced, and the working cost of large-screen configuration is increased.
In order to configure a large screen visual chart so that the chart can be normally displayed on a large screen, the data returned by the data interface for the large screen chart docking must conform to the data structure identifiable by the large screen chart. The data structure of the large screen chart is different from the interface data structure of the traditional data interface which is queried and returned from the database. Therefore, the interface data which is inquired and returned from the database cannot be directly used for the configuration of the large-screen chart, and the interface data can be suitable for the configuration of the large-screen chart only by certain data structure conversion.
Interface data returned from the database is subjected to data structure conversion to adapt to the data structure of the large-screen chart configuration. In order to solve the problem of data conversion, two general methods are used, namely, front-end modification, wherein data returned from an interface is obtained and accords with a chart structure, and back-end modification, wherein the data returned from a database is directly converted into a data structure which can be identified by a large-screen chart. While large screen configuration technology is now largely commercialized. The method modified from the front end is very costly and cannot be adapted to the idea of productization. Because the interface data returned by the back-end service has no very fixed format, the variation is relatively large, and the front-end cannot be completely adapted. Then only the back-end modification, i.e. the data service interface end of the large screen diagram docking, can be modified.
Back-end modification there are two approaches specifically. The method is characterized in that the method comprises the steps of modifying back-end codes, writing a unified method which can adapt to various charts, and converting data by the unified method. For example, the interface docking chart is a radar chart, namely before the interface returns data, the data structure of the returned data is converted by a radar chart data structure method, the data is returned to the large screen chart after conversion, the method needs to adapt each returned data, and later, if the data needs to be modified, new codes need to be re-adapted and added, so that the data structure adapting efficiency is reduced, the later maintenance cost is greatly increased, the popularization and the use are not facilitated, and secondly, the micro service docking is realized, namely, the data of all the large screen charts are firstly subjected to micro service docking, the micro service is subjected to uniform data structure conversion, and the large screen charts are uniformly docked with the interface after micro service conversion. In short, the interface to be docked of the original large screen is converted by the micro service conversion interface to generate a new interface, and the large screen chart is docked with the new interface. The method is that the structure conversion is carried out after the returned data is obtained through the request source interface, and a large screen is required to be configured with a plurality of charts. Overall, both of the above methods are costly and inefficient in project implementation.
Disclosure of Invention
Aiming at the problems, the invention provides a multi-metadata structure automatic conversion method and a multi-metadata structure automatic conversion system for large-screen chart adaptation, which are used for realizing the online visualization of the whole process of the large-screen data chart structure adaptation by arranging a visual service arranging method, an online operator arranging method, an online service debugging method and an online service testing method. The cost of the adaptation structure of the large-screen data chart configuration process is reduced, and the efficiency of the adaptation structure of the large-screen data chart configuration process is improved.
In a first aspect of the present invention, there is provided a method for automatically transforming a multi-metadata structure for large screen diagram adaptation, the method comprising the steps of:
Configuring a visual large screen chart, and configuring the attribute and the category of the chart by utilizing the visual large screen;
Configuring data interface service, including configuring data conversion type and data conversion flow;
The data line-column conversion operator and the data structure conversion operator are connected into a data conversion flow;
starting a data interface service to obtain converted data;
testing the data interface service by using the converted data until the verification result is correct;
The data line-row conversion operator specifically converts a one-dimensional/multi-dimensional array line into linear data through a visual arrangement method; the data structure conversion operator specifically converts a one-dimensional/multi-dimensional array structure into linear data through a visual arrangement method.
Further, the visual arrangement method specifically comprises the following steps:
Adding and modifying parameters of the data interface service;
writing a data structure conversion script;
and converting the data output by the script by using the data structure to adjust until the correctness of the script is verified.
Furthermore, the method also comprises the step of accessing the visualized large screen chart into a data interface service and displaying the converted data chart.
Further, the method also includes configuring the database connection and permissions, and configuring the database language, writing the database language into the data interface service.
In a second aspect of the present invention, there is provided an automatic multi-data structure conversion system for large screen diagram adaptation, comprising:
the visual large screen chart configuration module is used for configuring the attribute and the category of the chart by utilizing the visual large screen;
The data interface service configuration module is used for configuring the type and the flow of data conversion;
the operator arranging module is used for connecting the data rank conversion operator and the data structure conversion operator into the data conversion flow;
The data conversion module is used for starting the data interface service to obtain converted data;
The test module is used for testing the data interface service by using the converted data until the verification result is correct;
The operator arrangement module is used for arranging the data line and row conversion operators in the operator arrangement module, wherein the operator arrangement module is used for converting the one-dimensional/multi-dimensional array line and row into linear data through a visual arrangement method; the data structure conversion operator specifically converts a one-dimensional/multi-dimensional array structure into linear data through a visual arrangement method.
Further, the visual arrangement method in the operator arrangement module specifically includes the steps of:
Adding and modifying parameters of the data interface service;
writing a data structure conversion script;
and converting the data output by the script by using the data structure to adjust until the correctness of the script is verified.
Further, the system also comprises a display module for accessing the visual large screen chart into the data interface service and displaying the converted data chart.
Further, the system also comprises a data source acquisition module for configuring database connection and authority and configuring database language, and writing the database language into the data interface service.
In a third aspect of the present invention, a terminal is provided, comprising a processor, and a memory, wherein the memory stores a computer executable program, which when executed by the processor, performs the above-described method for automatically transforming a multi-data structure for large screen diagram adaptation.
In a fourth aspect of the present invention, a computer readable storage medium is provided, on which instructions are stored, which instructions, when executed by a processor, cause the processor to perform the above-described method of automatically transforming a multi-data structure for large screen diagram adaptation.
The method, the system and the computer storage medium for automatically converting the multi-metadata structure for adapting the large screen chart realize the whole-course visualization, the configurability and the conversion structure of the interface in the large screen configuration process, the large screen configuration personnel can finish the process by themselves without programming intervention of the rear end service personnel, the interface converted by the invention can perfectly conform to a line graph, a column graph, a pie graph, a radar graph and the like of the large screen configuration, can also adapt to other data structures of the large screen configuration, such as a table, a data index and the like, and can also adapt to the map layer data structure of the map layer configuration of the large screen map, so that interface data can be displayed on a map through the map layer perfectly. In the large screen configuration process, only one person is needed to complete the large screen configuration, so that the communication cost of the large screen configuration is reduced, and the efficiency of the large screen configuration is increased. The method has the beneficial effects that the visibility and efficiency of the large-screen data chart structure adapting process are improved by arranging the visualized large-screen data chart structure adapting operator. When a configurator configures the large-screen visual system, other personnel are not required to cooperate, and complex codes are not required to be written. Therefore, the efficiency of configuration personnel can be improved, the configuration personnel can be more focused on the configuration of the large-screen visual system, the configuration is not interfered by other factors, and the later maintenance of the system is improved.
Detailed Description
In order to further describe the technical scheme of the invention in detail, the embodiment is implemented on the premise of the technical scheme of the invention, and detailed implementation modes and specific steps are given.
The invention discloses a multi-data structure automatic conversion method for large-screen chart adaptation, which is shown in fig. 1, and comprises the following steps:
S01, configuring a visual large screen chart, and configuring attributes and categories of the chart by utilizing the visual large screen, wherein the chart attributes comprise colors, widths, heights and the like, and the chart categories comprise pie charts, bar charts and the like;
S02, configuring data interface service, including the type of configuration data conversion and the data conversion flow, specifically creating data conversion service, including the type of configuration data service including but not limited to GET, POST, PUT, DELETE, the flow of arranging data service, etc., arranging data service flow including but not limited to selecting a starting node, obtaining a data source, selecting a conversion operator, and then debugging;
S03, accessing a data line-column conversion operator and a data structure conversion operator into a data conversion flow;
The data structure conversion operator comprises a one-dimensional array structure conversion operator and a multi-dimensional array structure conversion operator, and particularly converts a one-dimensional/multi-dimensional array structure into linear data through a visual arrangement method. The one-dimensional array structure represents that only one group of data is in the target data structure, the one-dimensional array structure is represented by a one-dimensional line graph, a single column bar graph and the like on the display form of the chart, the multi-dimensional array structure represents that the target data structure contains 2 groups of data and more than 2 groups of data, the multi-series bar graph, the radar graph and the like on the display form of the chart, operators are services which are arranged through a visual arrangement method and serve as circulation methods in service visualization, and the operators are equivalent to a ring in a transfer flow, namely, the arranged operators are introduced in the process of configuring a data interface service, for example, the one-dimensional array line-column conversion operators are arranged into the data service flow.
Preferably, the line-column conversion is to convert the { key: value } structure into a { name: key, code: value } structure. The method is mainly applicable to the situation that both keys and values in the Json structure are taken out to be applied to the graph.
The structure conversion is to convert the [ { key1: value1, key2: value2}, { key1: value11, key2: value22} ] structure into { key: [ value1, value11], code: [ value2, value22] } structure. The method is mainly applicable to the situation that only the value in the Json structure is taken out to be applied to the chart.
Further, the visual arrangement method is shown in fig. 2, and the specific steps include:
s031, adding and modifying parameters of the data interface service;
s032, writing a data structure conversion script;
S033, converting the data output by the script by using the data structure to adjust until the correctness of the script is verified.
In the specific implementation process, parameters of the data interface service, such as CHARTNAME, CHARTTPYE, KEYFIELD, VALUEFIELD, are set and added, modified, a structured script is written, the structured script is put into an operator flow, output is set, failure output and success output of structure conversion are set, debugging, namely operator correctness is verified, and operators are introduced for verification and debugging.
S04, starting a data interface service to obtain converted data, namely, operating the well-arranged data service flow to enable the data conversion service to obtain the data;
s05, testing the data interface service by using the converted data until the verification result is correct, specifically, continuously debugging the data interface service until the displayed data result is correct, and further debugging is needed when the result display includes no display result;
Furthermore, the method also comprises the step of accessing the visualized large screen chart into a data interface service and displaying the converted data chart.
Further, the method further comprises configuring database connection and authority, configuring a database language, writing the database language into the data interface service, specifically configuring a data source, namely creating the data source, configuring a database link, a user name and a password of the data source, configuring and testing a database to be connected, and modifying and retesting configured database resources, wherein the database language comprises database query sentences.
The following describes a multi-metadata structure automatic conversion system for large-screen chart adaptation corresponding to the method shown in fig. 1 according to an embodiment of the present disclosure with reference to fig. 3, where the system 100 includes a visual large-screen chart configuration module 101 configured to configure attributes and categories of a chart by using a visual large-screen, a data interface service configuration module 102 configured to configure types and data conversion processes of data conversion, an operator arrangement module 103 configured to access a data line conversion operator and a data structure conversion operator into the data conversion processes, a data conversion module 104 configured to start a data interface service to obtain converted data, and a test module 105 configured to test the data interface service by using the converted data until a verification result is correct, where the data line conversion operator in the operator arrangement module 103 specifically converts a one-dimensional/multi-dimensional array into linear data by a visual arrangement method, and the data structure conversion operator specifically converts the one-dimensional/multi-dimensional array structure into linear data by a visual arrangement method. In addition to these 5 modules, the system 100 further includes a display module 107 for accessing the visual large screen chart to a data interface service and displaying the converted data chart.
Further, the visual arrangement method in the operator arrangement module 103 specifically includes the steps of adding and modifying parameters of the data interface service, writing a data structure conversion script, and adjusting by using data output by the data structure conversion script until correctness of the script is verified.
Further, the system 100 also includes a data source acquisition module 106 for configuring database connections and permissions, and configuring a database language, writing the database language into the data interface service.
In addition, the system 100 may include other components, which are not illustrated and described herein, as they are not relevant to the context of the disclosed embodiments.
The specific working process of the automatic multi-data structure conversion system 100 for large-screen chart adaptation refers to the description of the automatic multi-data structure conversion method for large-screen chart adaptation, and is not repeated.
The system of the embodiment of the invention can also be realized by means of the architecture of the computer terminal shown in fig. 4, and comprises a processor and a memory, wherein the memory stores a computer executable program, and when the processor executes the computer executable program, the automatic transformation method of the multi-data structure for large-screen chart adaptation is executed. Fig. 4 shows the architecture of the computer terminal. As shown in fig. 4, includes a computer system 201, a system bus 203, one or more CPUs 204, input/output components 202, memory 205, and the like. The memory 205 may store various data or files used for computer processing and/or communication and program instructions executed by the CPU. The architecture shown in fig. 4 is merely exemplary, and one or more of the components in fig. 4 may be adapted as needed to implement different devices.
Embodiments of the present invention may also be implemented as a computer-readable storage medium. The computer-readable storage medium according to an embodiment has computer-readable instructions stored thereon. The method for automatically transforming a multi-data structure for large screen diagram adaptation according to an embodiment of the present invention described with reference to the above drawings may be performed when the computer readable instructions are executed by a processor.
In summary, the method, the system and the computer storage medium for automatically converting the multi-metadata structure for large-screen chart adaptation realize the whole-course visualization, the configurability and the convertible structure of the interface in the large-screen configuration process, the large-screen configuration personnel can finish the process by themselves without programming intervention of the rear-end service personnel, the interface converted by the invention can perfectly conform to a line graph, a column graph, a pie graph, a radar graph and the like of the large-screen configuration, can also adapt to other data structures of the large-screen configuration, such as a table, a data index and the like, and can also adapt to a map layer data structure of the large-screen map layer configuration, so that interface data can be perfectly displayed on a map through a map layer. In the large screen configuration process, only one person is needed to complete the large screen configuration, so that the communication cost of the large screen configuration is reduced, and the efficiency of the large screen configuration is increased. The method has the beneficial effects that the visibility and efficiency of the large-screen data chart structure adapting process are improved by arranging the visualized large-screen data chart structure adapting operator. When a configurator configures the large-screen visual system, other personnel are not required to cooperate, and complex codes are not required to be written. Therefore, the efficiency of configuration personnel can be improved, the configuration personnel can be more focused on the configuration of the large-screen visual system, the configuration is not interfered by other factors, and the later maintenance of the system is improved.
In this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, or apparatus.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.