[0044] The technical scheme of the present invention will be described in further detail below in conjunction with the accompanying drawings and specific examples, so that those skilled in the art can better understand the present invention and implement it, but the examples given are not intended to limit the present invention .
[0045] The core idea of the present invention is to save the static and dynamic information of the monitoring page on the server in the form of monitoring page information, for example, in the form of an xml file. When the browser needs to display the corresponding monitoring page, the browser Flex parsing module first reads the static information of the monitoring page in the xml file, and generates a static monitoring page, and then the server page parsing module reads the monitoring page in the xml file The dynamic information of the dynamic information, combined with the interpretation strategy of the dynamic information, generates dynamic update data, and sends it to the browser in the form of message push, and the browser Flex parsing module in the browser updates the corresponding Flex control according to the received dynamic update data property, so as to generate a real-time monitoring page on the browser side. In the present invention, the monitoring page information can be generated by a visual editor, for example, the editor is a GEF (Graphic Editor Framework) editor.
[0046] In one embodiment of the present invention, as image 3 Shown, the described monitoring page display method based on Flex, it comprises the steps:
[0047] S200. The monitoring page information processing module of the server acquires monitoring page information including a plurality of Flex control information, and sends it to the browser;
[0048] S201. The browser Flex parsing module of the browser establishes a static monitoring page according to the monitoring page information;
[0049] S202. The server page parsing module obtains dynamically updated data according to the real business data obtained from the specific business module and the monitoring page information, and pushes it to the browser;
[0050] S203. The browser Flex parsing module of the browser displays a real-time monitoring page according to the static monitoring page and dynamic update data.
[0051] In a preferred embodiment of the present invention, before performing all steps, also include the following steps:
[0052] S100. Edit the monitoring page information through the monitoring page information editing module.
[0053] The monitoring page information processing module of the server can obtain monitoring page information in various ways, for example, it can be obtained from the monitoring page information database of the server according to the requirements of programmers, or directly through the programming personnel in the monitoring page information editing module. Edit the monitoring page information, and then send the edited monitoring page information to the monitoring page information processing module for processing. Wherein, the monitoring page information editing module can be implemented directly by using Flex, or can also use other editing platforms, for example, the monitoring page information can be edited by using a GEF editor.
[0054] For the monitoring page information, it can be a file in xml format, that is, describe the monitoring page information that includes the Flex control information in the form of an xml file, so that the xml file can be used in the actual business process. Transmission of information. The Flex control information is used to be defined by the user according to the needs of the specific business or the needs of the monitored scene, and then an xml file containing the Flex control information is generated and sent to the browser by the server, and finally the browser processes the xml file, and display the required monitoring page on the browser according to the Flex control information therein, wherein the monitoring page is composed of a plurality of corresponding Flex controls.
[0055] More preferably, after performing the step S100, it also includes:
[0056] S101. Store the monitoring page information into a monitoring page information database.
[0057] For the monitoring page information edited by the programmer through the monitoring page information processing module, it can be stored in the monitoring page information database, so that when a similar requirement is encountered in the future, for example, for this similar monitoring scene, it can be directly obtained from the monitoring page information database. The monitoring page information is retrieved from the monitoring page information database, thereby saving a certain workload of programmers and improving work efficiency.
[0058] In the Flex-based monitoring page display method provided by the present invention, the Flex control information includes several dynamic rule information and static rule information.
[0059] The Flex control information included in the monitoring page information can describe a plurality of corresponding Flex controls, through which a plurality of Flex controls can present a picture of the monitored scene in the form of a monitoring page on the browser end, thereby more vividly Provide basis and reference for managers.
[0060] Wherein, the pieces of static rule information included in each Flex control information reflect the static initial value of the monitoring page; the pieces of dynamic rule information reflect the dynamically changing value of the monitoring page. For its specific explanation, please refer to the following specific examples for understanding.
[0061] In the specific implementation process, in the step S201, the browser Flex parsing module of the browser creates a static monitoring page according to the static rule information included in the monitoring page information.
[0062] After receiving the monitoring page information, the browser Flex parsing module traverses all the static rule information in the monitoring page information, and sets up a static monitoring page according to the static rule information. For the static monitoring page, it does not have dynamic The ability to refresh the real-time data of a specific business module requires the further cooperation of the server page parsing module to achieve the purpose of dynamically presenting the working process of the specific business module in the monitored scene.
[0063] For this reason, in the specific implementation process, each of the dynamic rule information includes variable expressions of business data variables and corresponding dynamic update data. In the step S202, the server page parsing module acquires The real business data and the dynamic rule information included in the monitoring page information obtain dynamic update data, and push it to the browser.
[0064] After receiving the monitoring page information, the server page parsing module traverses all the dynamic rule information in the monitoring page information, and obtains dynamic update data according to the dynamic rule information and the received real business data sent by the specific business module When the server page analysis module makes a judgment that it needs to send the dynamic update data to the browser Flex analysis module, it pushes the dynamic update data to the browser Flex analysis module through a message push mechanism.
[0065] Preferably, the step S202 includes:
[0066] S2021. The server page parsing module traverses the dynamic rule information in all the Flex control information in the monitoring page information;
[0067] S2022. Obtain the current dynamic update data according to the real business data obtained from the specific business module in real time and the dynamic rule information;
[0068] S2023. When the current dynamic update data is different from the last dynamic update data, go to step S2024, otherwise, go to step S2022;
[0069] S2024. The server page parsing module pushes the current dynamic update data to the browser.
[0070] In said step S2023, when the current dynamic update data is the same as the last dynamic update data, it can be judged that the data does not need to be updated, so that the server page parsing module does not need to push the current dynamic update data to the browser, thereby to a certain extent can save network traffic.
[0071] According to an embodiment of the present invention, such as figure 2 As shown, it provides a monitoring page display system based on Flex, which includes a server 10 and a browser 20, wherein the server 10 includes a monitoring page information processing module 101, a server page parsing module 102 and a monitoring page information database 103 ,in,
[0072] The monitoring page information processing module 101 is used to obtain the monitoring page information including the Flex control information from the monitoring page information database 103, and send it to the server page analysis module 102 and the browser Flex analysis module 201;
[0073] The server page parsing module 102 is used to obtain dynamic update data according to the real business data obtained from the specific business module 30 and the monitoring page information, and push it to the browser 20; and
[0074] A monitoring page information database 103, configured to store the monitoring page information;
[0075] Described browser 20 comprises browser Flex parsing module 201, wherein,
[0076] Browser Flex parsing module 201, is used for obtaining described monitoring page information and according to described monitoring page information, establishes static monitoring page; Monitor page.
[0077] In this embodiment, the monitoring page display system based on Flex can also include a monitoring page information editing module 40, which is used to edit the monitoring page information containing Flex control information, and then send the monitoring page information to the monitoring page information editor The module 40 is also stored in the monitoring page information database 103 .
[0078] According to another embodiment of the present invention, such as figure 2 As shown, the Flex-based monitoring page display system provided by it includes a server 10 and a browser 20, wherein the server 10 includes a monitoring page information processing module 101, a server page parsing module 102 and a monitoring page information editing module 40, wherein ,
[0079] Monitoring page information editing module 40, in order to edit the monitoring page information comprising Flex control information;
[0080] The monitoring page information processing module 101 is used to obtain the monitoring page information from the monitoring page information editing module 40, and send it to the server page parsing module 102 and the browser Flex parsing module 201; and
[0081] The server page parsing module 102 is used to obtain dynamic update data according to the real business data obtained from the specific business module 30 and the monitoring page information, and push it to the browser 20;
[0082] Described browser 20 comprises browser Flex parsing module 201, wherein,
[0083] Browser Flex parsing module 201, is used for obtaining described monitoring page information and according to described monitoring page information, establishes static monitoring page; Monitor page.
[0084] In this embodiment, the Flex-based monitoring page display system can also include a monitoring page information database 103, after the programmer has edited the corresponding monitoring page information through the monitoring page information editing module 40, he can pass it through the monitoring page The information processing module 101 is stored in the monitoring page information database 103, so that it is convenient for programmers to call when they encounter the same business requirement or monitored scene next time, which can save the workload of programmers and improve their work efficiency to a certain extent.
[0085] The Flex-based monitoring page display method and system provided by this embodiment will be explained in detail below.
[0086] In this embodiment, the Flex-based monitoring page display method includes the following specific steps:
[0087] 1. Define the Flex control information of the monitoring page information, the static rule information and the dynamic rule information of the Flex control information through the monitoring page information editing module 40, thereby generating the monitoring page information. Wherein, the monitoring page information editing module 40 can be a GEF editor, and programmers can edit the required monitoring page information that meets business requirements or monitoring scene requirements through the visualized GEF editor. In addition, the monitoring The page information editing module 40 can also be an editing tool in other forms, for example, in an actual application process, the function of an editor can also be implemented directly based on Flex to edit the monitoring page information.
[0088] According to the business characteristics of real-time monitoring, the Flex controls here can be divided into three categories:
[0089] (1) Flex controls that come with Flex, such as text boxes, labels, picture boxes, etc.;
[0090] (2) Third-party open source Flex controls, such as chart controls, etc.;
[0091] (3) Programmers customize the Flex controls through the monitoring page information editing module 40 , such as dashboards, voltmeter controls, and the like.
[0092]In this embodiment, the static attributes allowed to be set by the Flex control information are called static rule information. For example, for a text box control, the static rule information that it can support includes abscissa, ordinate, background color, border color, Whether there is a border, text box content, etc.; the dynamic change behavior allowed by the Flex control information is called dynamic rule information. For example, for the text box control, the dynamic rule information it can support includes the text output of the text box and the background color of the text box changes etc.
[0093] Besides, in this step, each Flex control information can support several static rule information and dynamic rule information.
[0094] 2. Use the xml file to describe the monitoring page information.
[0095] An xml file is used to describe monitoring page information. Each monitoring page information is composed of descriptions of several Flex control information, and each Flex control information is composed of descriptions of static rule information and dynamic rule information it can support.
[0096] Among them, each dynamic rule information consists of the following two aspects of information:
[0097] (1) Regarding business data variable script expressions, or variable expressions.
[0098] For the variable expression, JavaScript can be used as a scripting language in an actual implementation process. In JavaScript expressions, business data variables are identified by certain delimiters, such as starting with "${" and ending with "}".
[0099] (2) Dynamic update data generation rules, or called generation rules.
[0100] The generating rule means that when the value obtained by substituting specific real business data into the variable expression satisfies a predefined rule, a corresponding property of the corresponding Flex control should be updated accordingly.
[0101] Taking the dynamic rule information of the background color change of the text box control as an example, its variable expression can be described as: ${A point voltage}, and the generation rule of its dynamic update data can be described as: when specific real business data is substituted into the When the value obtained by the above variable expression is between 0 and 5, the background color property of the text box should be updated to white; when the obtained value is between 5 and 10, the background color property of the text box should be updated to red. The generation rules of the dynamic update data can be defined by those skilled in the art based on the basic knowledge, and there will not be too many details and scope limitations here.
[0102] The xml file describing the monitoring page information of a specific monitoring scene includes all the Flex control information required by the monitoring page, and the static rule information and dynamic rule information of each Flex control information.
[0103] In this implementation, the xml file can be generated by a visual editor. In a specific implementation of this embodiment, the editing of monitoring page information can be realized based on Flex, including editing of static rule information on Flex control information and binding of dynamic rule information, and finally generating xml file with dynamic rule information.
[0104] 3. The browser Flex parsing module 201 reads the static rule information of each Flex control information in the above-mentioned xml file, and generates a static monitoring page.
[0105] Before the browser 20 displays the static monitoring page, the browser Flex parsing module 201 obtains the xml file corresponding to the monitoring page information from the server 10, and reads the static rule information of each Flex control information. Since the static rule information is some attribute values of the Flex control information, a static monitoring page can be generated according to the syntax of Action Script.
[0106] At this time, the monitoring page generated by the browser 20 is static and does not have the ability to refresh dynamically, but only displays the initial state of each Flex control in the monitoring page.
[0107] 4. The server page parsing module 102 reads the dynamic rule information of each Flex control information in the xml file, and generates dynamic update data in combination with the interpretation strategy.
[0108] After the server page parsing module 102 obtains the xml file of the monitoring page information, that is, while performing the above step 3, the server page parsing module 102 reads the xml file, loops through all the Flex control information, and traverses all the Flex control information. Dynamic rule information. For each dynamic rule information, dynamic update data is generated according to the following interpretation strategy.
[0109] (1) For variable expressions in the dynamic rule information, replace business data variables with real business data.
[0110] First, the server page parsing module 102 obtains the real business data of the corresponding business data variable from the specific business module 30, and then replaces the variable in the corresponding variable expression through the pre-defined delimiter identification, for example, the variable expression is: ${ Temperature X} > 26, assuming that the real business data of temperature X is 24 at this time, the variable expression after replacement is: 24 > 26.
[0111] (2) Use the script engine to calculate the value of the variable expression and generate the current dynamic update data. For example, in a specific implementation manner, for JavaScript scripts, the corresponding JavaScript engine can be used to calculate the value of the variable expression according to the obtained real business data, and generate current dynamic update data. For example, after substituting the real business data into the variable expression, the JavaScript expression of 24 > 26 is obtained, and the script engine is used to calculate its value as false. Afterwards, dynamically update data is generated according to the generation rules included in the dynamic rule information. For example, because the expression value is false, the text of the corresponding Flex control should be updated to "the temperature is too low".
[0112] (3) If the current dynamic update data is obtained for the first time, then proceed to step (4); otherwise, judge whether the current dynamic update data is the same as the last time, if and only if the current dynamic update data calculated this time is the same as Only go to step (4) when it is inconsistent last time, otherwise go to step (2).
[0113] (4) Push the current dynamic update data to the browser Flex parsing module 201.
[0114] For the dynamic update data, its format may be "control ID-attribute-value". In the Flex control information, different dynamic rule information may affect different properties of the Flex control. Taking display and hiding as an example, for its dynamic rule information, when the value of the obtained dynamic update data is true, the Flex control is displayed; otherwise, the Flex control is hidden. Therefore, when the format of the dynamically updated data is "0001-visible-true", its corresponding Flex control is displayed.
[0115] It can be seen that the dynamic update data pushed by the server page parsing module 102 to the browser Flex parsing module 201 is combined with real business data and dynamic rule information of business data variables, and is generated as a dynamic data in the format of "control ID-attribute-value". update data.
[0116] In the above-mentioned step (3), when the dynamic update data calculated according to the real business data has not changed, the properties of the corresponding Flex controls at the browser 20 end must not need to be updated, so the server page parsing module 102 does not need to update at this time. The current dynamic update data is pushed to the browser Flex parsing module 201, thereby saving network traffic to a certain extent.
[0117] For the way that the server page parsing module 102 pushes the current dynamic update data to the browser Flex parsing module 201, in a preferred implementation of this embodiment, the BlazeDS open source component provided by Adobe can be used to realize Message push.
[0118] 5. The browser Flex parsing module 201 receives the dynamic update data and updates the properties of the corresponding Flex controls, thereby generating a monitoring page in real time.
[0119] After the browser Flex parsing module 201 receives the dynamic update data, it first searches for the corresponding Flex control object according to the dynamic update data, for example, according to the control ID information in the dynamic update data, and then according to the Flex control attribute name and value , modify the properties of the Flex control, thereby realizing the dynamic real-time refresh of the monitoring page, and obtaining the real-time monitoring page.
[0120] The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the description of the present invention and the contents of the accompanying drawings, or directly or indirectly used in other related All technical fields are equally included in the scope of patent protection of the present invention.