Detailed Description
The embodiment of the application provides a new method for realizing a business diagram, all data required by a client for displaying the business diagram are divided into business data and configuration data, and the corresponding relation between a business diagram identifier and business data source information and a configuration data identifier is maintained at a server; the server side returns corresponding configuration data identification and service data information to the client side according to the service chart identification to be displayed uploaded by the client side, and the client side obtains configuration data and service data according to the configuration data identification and the service data information to display the service chart; therefore, the service parameter displayed in the service chart and/or the mode of displaying the service parameter can be modified by modifying the service data source information and/or the configuration data identifier corresponding to the service chart identifier at the server side, so that the updating of the display is decoupled from the realization of the client side, and the problems in the prior art are solved.
In the embodiment of the application, the client and the server form a chart service system. The client runs on equipment on the user side, such as mobile phones, tablet computers, PCs (Personal computers), notebooks and other equipment; the server runs on a device on the network side, which may be a PC, a server, or the like, or two or more devices sharing different responsibilities cooperate with each other to implement each function of the server in the embodiment of the present application.
In the embodiment of the application, for all data required by displaying the service graph on the client, which part of the data is used as configuration data can be determined according to the specific implementation of the actual application scene, and the rest part of the data is used as service data. Data which can be reused for displaying a plurality of service charts in an actual application scene can be used as configuration data, and partial data which may be different due to the service charts can be used as service data. The business data generally includes values of business variables to be displayed in a business graph, and portions of displayed explanatory texts that vary depending on the business variables; configuration data typically includes data related to how business variables are displayed, such as the type of chart (line chart, bar chart, pile chart, pie chart, radar chart, etc.), style data for that type, the portion of the displayed caption that is common to multiple business variables, and so forth. It should be noted that the service data may also include data related to how to display the service variable, for example, when some display parameters may be different due to different displayed service variables, the part of the display parameters may be used as the service data.
In a graph service system formed by a client and a server, each business graph displayed by the client by adopting the method of the embodiment of the application has a unique identifier, and each configuration data also has a unique identifier. The service diagram identifier may be any information that can represent the service diagram and distinguish the service diagram from other service diagrams in the diagram service system, and the embodiment of the present application is not limited; the same is true of the configuration data identification.
In the embodiment of the application, the server maintains the corresponding relation between the identifier of the service chart and the service data source information of the service chart, and the configuration data identifier. The service data source information may be a call interface provided by the service server, a predetermined network location for storing the service data, and the like, and is not limited as long as the service end or the client can obtain the service data to be displayed from the designated service data source after obtaining the service data source information.
In the embodiment of the present application, a flow of the service graph application method applied to the client is shown in fig. 1, and a flow of the service graph application method applied to the server is shown in fig. 2.
At the client, step 110, an identifier of the service graph to be displayed is sent to the server.
At the server, step 210, an identifier of the service graph to be displayed sent by the client is received.
When the client needs to display the service chart in the operation process, a chart data request is sent to the server, and the chart data request carries the identifier of the service chart to be displayed.
At the server, step 220, the service data information is determined according to the service data source information corresponding to the service graph identifier.
After receiving the chart data request, the server side extracts the service chart identifier therein, searches the corresponding relationship maintained by the server side, and obtains the service data source information and the configuration data identifier corresponding to the service chart identifier.
In one implementation, the service end may obtain the service data from the service data source specified by the service data source information, and return the obtained service data to the client as the service data information.
In another implementation manner, the service end may return the service data source information to the client as the service data information, and the client acquires the service data from the service data source specified by the service data source information.
At the server, step 230, the service data information and the configuration data identifier corresponding to the service diagram identifier are returned to the client, so that the client can display the service diagram based on the service data information and the configuration data information.
At the client, step 120, service data information and configuration data identification are received from the server, and the service data information and configuration data identification are determined by the server according to the identification of the service chart.
And the server encapsulates the service data information and the configuration data identifier corresponding to the service chart identifier in the chart data response, and returns the chart data response to the client.
At the client, step 130, the configuration data is obtained according to the configuration data identifier, and the service graph is displayed based on the configuration data and the service data information.
In one implementation, all available configuration data may be saved at the client. After extracting the configuration data identifier from the chart data response, the client searches the configuration data with the identifier from the stored plurality of configuration data. In this implementation, if new configuration data is to be added or existing configuration data is to be changed, the client needs to be upgraded.
In another implementation, the client holds several pieces of configuration data locally. After receiving the chart data response, searching in the configuration data stored locally according to the configuration data identifier, and reading the configuration data if the configuration data with the identifier exists. If the configuration data with the identification does not exist, sending a configuration data request to the server, wherein the configuration data request carries the identification of the configuration data; the server side returns the configuration data with the identification to the client side; and after receiving the configuration data, the client stores the received configuration data and the corresponding configuration data identifier locally. In the implementation mode, the client can pre-store some configuration data during installation, when new configuration data needs to be added or existing configuration data needs to be changed, the server can give a new identifier to the new configuration data or the modified configuration data, and the client can automatically download the corresponding configuration data from the server, so that the automatic update of the configuration data can be realized without upgrading the client. In addition, a life cycle can be set for the stored configuration data at the client, and when the time from the last use of certain configuration data exceeds the life cycle, the configuration data is deleted, so that the old configuration data is cleared in time.
In the implementation mode of using the service data source information as the service data information, after receiving the chart data response, the client acquires the service data of the service chart from the service data source specified by the service data source information. In the implementation mode using the service data as the service data information, the client directly extracts the service data from the chart data response.
And after the service data and the configuration data are obtained, the client displays a service chart by adopting the service data and the configuration data. Specifically, the client combines the service data and the configuration data to obtain all data of the service chart, and displays the service chart according to the combined data. The specific manner of combining the service data and the configuration data and the specific manner of displaying the service diagram may be determined according to the dividing manner of the service data and the configuration data in the actual application scenario, the software and hardware platform operated by the client, the programming implementation of diagram display, and the like, and the embodiment of the present application is not limited. In one example, the client may generate a graph object using the service data and the configuration data, and display the service graph according to the generated graph object; generating the chart object and displaying the service chart according to the chart object can be realized by referring to the prior art, and are not described again.
In some application scenarios, some service charts need to be displayed with different configuration data under different situations. For example, different color displays may be used for different time periods, different styles may be used for different groups of users, etc. In these application scenarios, the situations using different configuration data may be described by using predetermined applicable conditions, so that each configuration data that may be used by the service graph has its own predetermined applicable condition, and the predetermined applicable conditions of the different configuration data are mutually exclusive (i.e. any determined situation can only satisfy the predetermined applicable condition of one configuration data). In the corresponding relation between the service chart identifier and the service data source information and the configuration data identifier maintained by the server, each configuration data identifier which is possibly used and corresponds to the service chart identifier and the preset applicable condition of each configuration data identifier are saved. After the server receives the chart data request of the client, if the service chart identifier in the chart data request in the maintained corresponding relation corresponds to two or more configuration data identifiers, the current situation meets the preset applicable condition of which configuration data identifier, and the server returns which configuration data identifier to the client.
In some services, a service graph may be used to display both one service variable and two or more service variables simultaneously. At this time, the service end can enable the service data obtained by the client end to include one to a plurality of values of the service variable through the service data information, and the client end adopts the configuration data of the service chart to respectively display the service variable on the service chart according to the value of each service variable. Therefore, one to a plurality of business variables can be displayed on the same business chart according to the business data information returned by the server. The realization can increase and delete the business variable displayed in the business chart at any time by modifying the business data source information in the corresponding relation of the service end when the business scene changes.
Therefore, in the embodiment of the application, the configuration data can be reused for displaying a plurality of service data by separating the service data from the configuration data, so that the development workload is reduced; the service data information and the configuration data identification of the service chart are issued by the server, so that the service data to be displayed and/or the configuration data to be adopted of the service chart can be changed at any time by modifying the corresponding relation of the service chart identification at the server without changing the implementation of the client, and the client is prevented from being upgraded; therefore, the chart display can be timely and quickly matched with the service change, and the stability of the client cannot be influenced by frequent upgrading of the modified chart display.
In an application example of the application, a network service provider runs a server terminal ChartKitServer of a graph service system on a server thereof, and service terminals of a plurality of business systems; a user installs an App (application program) of the network service provider on a terminal of the user, wherein the App comprises a client terminal ChartKit of a graph service system; the displaying of the business chart in the App is completed by the cooperation of ChartKit and ChartKitServer.
The structures of ChartKit and ChartKitServer are shown in FIG. 3. The ChartKit includes two sub-modules, ChartEngine and DataEngine, wherein: the ChartEngine submodule is responsible for drawing a service chart, and comprises generation of information such as legends, explanatory documents and the like; the DataEngine sub-module is responsible for acquiring business data, acquiring and maintaining configuration data and synthesizing the business data and the configuration data.
The ChartKitServer comprises an operation support submodule, a data release submodule and a configuration management submodule, wherein: the operation support submodule is responsible for maintaining a corresponding relation table of a service chart identifier and a service system interface (service data source information) and a configuration data identifier; the data publishing sub-module is responsible for acquiring the service data and sending the service data and the configuration data identifier to the client for displaying the service chart; the configuration management submodule is responsible for creating, publishing and maintaining configuration data of the business chart.
When a developer needs to display a service graph by using new configuration data in the App, the developer needs to register the new configuration data to the ChartKitServer. Specifically, new configuration data is added in a configuration management submodule, and a developer designates or the configuration management submodule generates a unique identifier of the new configuration data; and then, adding a new row record using the new configuration data identifier in a corresponding relation table maintained by the operation support submodule, or changing the configuration data identifier in the existing row record into the identifier of the new configuration data. The developer may also modify the display of the business graph by modifying existing configuration data (the configuration data identity is unchanged) in the configuration management submodule. That is, new configuration data may be added or existing configuration data may be changed without upgrading the App. The developer can also change the service parameters to be displayed and/or the configuration data to be adopted in a certain service diagram by modifying the corresponding relation table in the operation support submodule without upgrading the App.
When a certain service chart is to be displayed in App, the identifier of the service chart (assuming that the identifier of the service chart is ChartID-a) is transmitted into ChartKit. The DataEngine submodule of the ChartKit sends a chart data request to the data issuing submodule of the ChartKitServer, and the chart data request carries ChartID-A.
And the data issuing submodule of the ChartKitServer extracts ChartID-A from the chart data request, and initiates query to the operation support submodule by using the ChartID-A. And the operation support submodule searches a service system interface (set as an interface t of a service system m) corresponding to the ChartID-A and a configuration data identifier (set as Config-1) in the maintained corresponding relation table, and transmits the configuration data identifier to the data release submodule.
And the data issuing submodule calls an interface t of the service system m to obtain service data to be displayed in the ChartID-A. The data publishing sub-module encapsulates the service data (a kind of service data information) and the configuration data identifier Config-1 in the chart data response, and sends the chart data response to the DataEngine sub-module of the ChartKit.
The DataEngine sub-module of ChartKit extracts service data and a configuration data identifier Config-1 from the chart data response, searches whether the configuration data identified as Config-1 exists in the locally stored configuration data, and reads the configuration data identified as Config-1 if the configuration data exists. If the local configuration data identified as Config-1 does not exist, the DataEngine submodule generates a configuration data request carrying the Config-1 and sends the configuration data request to the configuration management submodule of the ChartKitServer. Since registration is already completed in the configuration management submodule before each configuration data identifier is applied to the correspondence table, all usable configuration data is saved in the configuration management submodule. The configuration management sub-module finds out the configuration data marked as Config-1, encapsulates the configuration data in a configuration data response and returns the configuration data to the DataEngine sub-module. And after receiving the configuration data response, the DataEngine sub-module obtains the configuration data marked as Config-1 and stores the configuration data in the local.
After the service data and the configuration data are obtained, the DataEngine submodule combines the service data and the configuration data to generate a general chart model (a chart object), and transmits the general chart model to the ChartEngine submodule.
And the ChartEngine submodule generates a service chart according to the general chart model and displays the service chart in the App.
Corresponding to the implementation of the above flow, the embodiment of the present application further provides an implementation device for a service graph applied to a client, and an implementation device for a service graph applied to a server. Both of these means can be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, the logical device is formed by reading a corresponding computer program instruction into a memory for running through a Central Processing Unit (CPU) of the device. In terms of hardware, the device in which the service graph implementation apparatus is located generally includes other hardware such as a chip for transmitting and receiving wireless signals and/or other hardware such as a board for implementing a network communication function, in addition to the CPU, the memory, and the nonvolatile memory shown in fig. 4.
Fig. 5 is a diagram illustrating an implementation apparatus of a service graph, which is applied to a client and includes a service graph identifier sending unit, a graph data information receiving unit, and a service graph display unit, where: the service chart identifier sending unit is used for sending the identifier of the service chart to be displayed to the server; the chart data information receiving unit is used for receiving service data information and configuration data identification from the server, and the service data information and the configuration data identification are determined by the server according to the identification of the service chart; and the service chart display unit is used for acquiring configuration data according to the configuration data identifier and displaying the service chart based on the configuration data and the service data information.
Optionally, the obtaining, by the service graph display unit, the configuration data according to the configuration data identifier includes: when the configuration data with the configuration data identification is locally stored, reading the stored configuration data; otherwise, the configuration data identifier is adopted to obtain the configuration data from the server side, and the configuration data and the corresponding configuration data identifier are stored locally.
Optionally, the service data information includes: and (4) service data.
Optionally, the service data information includes: source information of the service data; the service chart display unit displays the service chart based on configuration data and service data information, and comprises: and acquiring the service data from the service data source specified by the source information of the service data, and displaying the service chart by adopting the service data and the configuration data.
Optionally, the service graph displaying unit displays the service graph based on the configuration data and the service data information, including: and generating a chart object by adopting the service data and the configuration data, and displaying the service chart according to the chart object.
Optionally, the service data includes: a value of one to a plurality of business variables; the service chart display unit displays the service chart based on configuration data and service data information, and comprises: and respectively displaying each business variable on the business chart according to the value of each business variable by adopting configuration data.
Fig. 6 shows an implementation apparatus for a service graph, which is applied to a server, where the server maintains a correspondence between an identifier of the service graph and service data source information and a configuration data identifier of the service graph, and the apparatus includes a service graph identifier receiving unit, a service data information determining unit, and a graph data information sending unit, where: the service chart identification receiving unit is used for receiving an identification of a service chart to be displayed, which is sent by the client; the service data information determining unit is used for determining service data information according to the service data source information corresponding to the service chart identifier; the chart data information sending unit is used for returning service data information and a configuration data identifier corresponding to the service chart identifier to the client, so that the client can display the service chart based on the service data information and the configuration data information.
Optionally, the apparatus further comprises: and the configuration data issuing unit is used for returning the configuration data with the configuration data identifier to the client after receiving the configuration data request with the configuration data identifier of the client.
Optionally, the identifier of the service graph corresponds to two or more configuration data identifiers, and different configuration data identifiers have mutually exclusive predetermined applicable conditions; the chart data information sending unit is specifically configured to: and returning service data information to the client, and the configuration data identifier meeting the preset applicable condition in the configuration data identifier corresponding to the service chart identifier.
Optionally, the service data information includes: service data; the service data information determining unit is specifically configured to: and acquiring the service data from the service data source specified by the service data source information, and taking the acquired service data as the service data information.
Optionally, the service data information includes: service data source information; the service data information determining unit is specifically configured to: and taking the service data source information corresponding to the service chart identification as service data information.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, 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, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.