[go: up one dir, main page]

CN108363760A - IETM display datas based on B/S models generate and Off-line control method - Google Patents

IETM display datas based on B/S models generate and Off-line control method Download PDF

Info

Publication number
CN108363760A
CN108363760A CN201810105293.8A CN201810105293A CN108363760A CN 108363760 A CN108363760 A CN 108363760A CN 201810105293 A CN201810105293 A CN 201810105293A CN 108363760 A CN108363760 A CN 108363760A
Authority
CN
China
Prior art keywords
information
offline
data
file
ietm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810105293.8A
Other languages
Chinese (zh)
Inventor
王兴松
叶逢雨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southeast University
Original Assignee
Southeast University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Southeast University filed Critical Southeast University
Priority to CN201810105293.8A priority Critical patent/CN108363760A/en
Publication of CN108363760A publication Critical patent/CN108363760A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种基于B/S模型的IETM显示数据生成及离线控制方法,包括如下步骤:1)管理员根据信息类型通过带校验规则的表单录入数据;2)数据发送到后台服务器经过处理插入数据库;3)在用户需要信息时通过查询获取到数据信息,根据信息类型确定需要离线下载的本地缓存资源;4)动态生成manifest文件控制离线的本地缓存;5)将获取到的信息转化成JSON格式直接填入到预先定制好的ejs模板中生成HTML5文件;6)将HTML5文件和manifest文件一同发送给请求的客户端。本发明和主流的XML数据通过添加XSL文档转化为HTML数据模块相比,模板生成的HTML5文件的方法使发布数据编写的工作量更小,同时实现了离线访问,解决B/S模型下无网络连接不能使用的缺陷。

The invention discloses a B/S model-based IETM display data generation and off-line control method, comprising the following steps: 1) an administrator enters data through a form with verification rules according to the information type; 2) the data is sent to the background server through 3) Obtain data information through query when users need information, and determine the local cache resources that need to be downloaded offline according to the information type; 4) Dynamically generate a manifest file to control the offline local cache; 5) Convert the obtained information Fill in the JSON format directly into the pre-customized ejs template to generate an HTML5 file; 6) Send the HTML5 file and the manifest file to the requesting client. Compared with the mainstream XML data converted into HTML data modules by adding XSL documents, the method of HTML5 files generated by the template makes the workload of publishing data writing smaller, and realizes offline access at the same time, solving the problem of no network under the B/S model A defect in which the connection cannot be used.

Description

基于B/S模型的IETM显示数据生成及离线控制方法IETM Display Data Generation and Offline Control Method Based on B/S Model

技术领域technical field

本发明涉及交互式电子手册技术,具体涉及一种基于浏览器/服务器(B/S)模型的交互式电子手册显示数据模块生成及离线访问控制方法。The invention relates to an interactive electronic manual technology, in particular to a browser/server (B/S) model-based interactive electronic manual display data module generation and off-line access control method.

背景技术Background technique

交互式电子手册,简称IETM(interactive electronic technical manual),是近年来为解决产品基层级维修孕育而生的一种电子交付物,它利用计算机多媒体、数据库和网络等技术,将内容繁杂的操作手册、维修手册等信息有机组织管理起来,并以最优化的方式将文字、表格、图像、工程图形、声音、视频、动画等多种信息形式显示在电子屏幕上。Interactive electronic manual, referred to as IETM (interactive electronic technical manual), is an electronic deliverable that has been born to solve the problem of basic-level maintenance of products in recent years. It uses computer multimedia, database and network technologies to convert complex operation manuals into , Maintenance manuals and other information are organically organized and managed, and various information forms such as text, tables, images, engineering graphics, sounds, videos, animations, etc. are displayed on the electronic screen in an optimized manner.

IETM的主要标准有美军的于2000年5月发布的MIL-HDBK-511标准,欧洲的S1000D标准,国内标准为2009年10月发布的GB/T 24463IETM系列。其中欧洲的S1000D标准因具有广泛的支持和完善的维护体制,被世界上各大组织所推崇,我国的IETM标准也是参照该标准定制的。根据国内的GB/T24463.1-2009标准,推荐的IETM互操作性结构体系有四种,分别为C1类型:基本HTML/XML页面;C2类型:简单可下载组件;S1类型:HTML+应用程序服务器;S2类型:HTML+数据库服务器。The main standards of IETM include the MIL-HDBK-511 standard issued by the US military in May 2000, the S1000D standard in Europe, and the GB/T 24463IETM series released in October 2009 as the domestic standard. Among them, the European S1000D standard is highly respected by major organizations in the world because of its extensive support and perfect maintenance system. The IETM standard in my country is also customized with reference to this standard. According to the domestic GB/T24463.1-2009 standard, there are four recommended IETM interoperability structures, namely C1 type: basic HTML/XML page; C2 type: simple downloadable components; S1 type: HTML+ application server ;S2 type: HTML+database server.

目前大多数军方使用的IETM的平台采用专用客户端,即客户端/服务器(C/S)模型。该模型安全性较高,同时可以实现离线访问,在线更新的功能,但是安装成本和使用成本较高。对于民用设备,为了降低使用成本和开发成本,可采用浏览器/服务器(B/S)模型。同时采用通用浏览器可大大降低用户的学习成本。在B/S模型下,数据显示方式目前分为两种模式:The IETM platform currently used by most of the military adopts a dedicated client, that is, a client/server (C/S) model. This model has higher security and can realize offline access and online update functions, but the installation cost and use cost are relatively high. For civilian equipment, in order to reduce the use cost and development cost, a browser/server (B/S) model can be adopted. At the same time, the use of a common browser can greatly reduce the user's learning costs. Under the B/S model, data display methods are currently divided into two modes:

一种是通用的XML数据格式,通过添加XSL文件,可以将数据转化为HTML格式,然后在浏览器上显示。这种形式可以通过数据库导出的信息处理后生成统一的XML格式数据再加上事先定制XSL文件。这种做法可以事先定制XML格式和XSL格式,将信息分为通用结构信息、图解零部件信息、描述性信息、程序性信息、故障信息、维修计划信息、接线信息、人员信息等等,则只需要在录入的时候定制录入模板,就可获得一定格式的XML格式,再配上相应信息种类的的XSL格式,因XML格式可由数据库内的信息控制,只需编写特定种类的XSL文档即可,极大地减少显示格式数据的编写。但是这种方式生成的HTML不能使用HTML5的新技术——离线应用技术,不能进行数据离线的本地缓存,在无Internet时不可使用。One is a common XML data format, by adding XSL files, the data can be converted into HTML format, and then displayed on the browser. This form can generate unified XML format data after processing the information exported from the database, and then customize the XSL file in advance. In this way, the XML format and XSL format can be customized in advance, and the information can be divided into general structural information, graphical component information, descriptive information, procedural information, fault information, maintenance plan information, wiring information, personnel information, etc., and only It is necessary to customize the input template at the time of input, and then you can obtain the XML format of a certain format, and then match it with the XSL format of the corresponding information type. Because the XML format can be controlled by the information in the database, you only need to write a specific type of XSL document. Dramatically reduces the writing of display format data. However, the HTML generated in this way cannot use the new technology of HTML5 - offline application technology, and cannot perform offline local cache of data, and cannot be used when there is no Internet.

另一种是在数据库中存储每个信息内容然,由后台服务器取出后为每个页面编写相应的HTML文件,这种个形式交互性较好。然后可为整个应用定制离线缓存原则,实现离线访问(目前没有发现有人实现)。但是这种实现需要为每个每个信息页面编写HTML文件和manifest文件,工作量巨大。The other is to store each information content in the database, and then write the corresponding HTML file for each page after being retrieved by the background server. This form has better interactivity. Then the offline caching principle can be customized for the entire application to achieve offline access (no one has been found to implement it yet). But this kind of implementation needs to write HTML files and manifest files for each information page, and the workload is huge.

发明内容Contents of the invention

发明目的:为了克服现有技术中存在的采用XML的数据格式来交换数据,在B/S模型的架构下无法实现离线访问,而以HTML的数据格式来交换显示数据,会导致需要为每个页面编写HTML格式,增加系统编写的成本的不足,提供一种基于B/S模型的IETM显示数据生成及离线访问控制方法。Purpose of the invention: In order to overcome the exchanging of data in XML data format in the prior art, offline access cannot be realized under the architecture of the B/S model, but exchanging and displaying data in HTML data format will lead to the need for each The page is written in HTML format, which increases the cost of system writing, and provides a B/S model-based IETM display data generation and offline access control method.

技术方案:为实现上述目的,本发明提供一种基于B/S模型的IETM显示数据生成及离线访问控制方法,包括如下步骤:Technical solution: In order to achieve the above object, the present invention provides a B/S model-based IETM display data generation and offline access control method, including the following steps:

1)管理员根据信息类型通过带校验规则的表单录入数据;1) The administrator enters data through a form with verification rules according to the type of information;

2)数据发送到后台服务器经过处理插入数据库;2) The data is sent to the background server and inserted into the database after processing;

3)在用户需要信息时通过查询获取到数据信息,根据信息类型确定需要离线下载的本地缓存资源;3) Obtain data information through query when the user needs information, and determine the local cache resources that need to be downloaded offline according to the type of information;

4)动态生成manifest文件控制离线的本地缓存;4) Dynamically generate the manifest file to control the offline local cache;

5)将获取到的信息转化成JSON格式直接填入到预先定制好的ejs模板中生成HTML5文件;5) Convert the obtained information into JSON format and directly fill it into the pre-customized ejs template to generate HTML5 files;

6)将HTML5文件和manifest文件一同发送给请求的客户端。6) Send the HTML5 file and the manifest file to the requesting client.

进一步地,所述步骤2)中数据库的信息种类和界面的种类需要提前设计,然后编写界面的模板,按照不同的信息类型编写不同的ejs模板,将获取的信息填入不同的模板,形成访问连接,所述数据库的信息种类按照类型分别分为:通用结构信息、图解零部件信息、描述性信息、程序性信息、故障信息、维修计划信息、接线信息、人员信息等。Further, the type of information of the database and the type of the interface in the step 2) need to be designed in advance, and then the template of the interface is written, and different ejs templates are written according to different information types, and the obtained information is filled into different templates to form an access Connection, the information types of the database are divided into: general structure information, diagram parts information, descriptive information, procedural information, fault information, maintenance plan information, wiring information, personnel information, etc. according to types.

进一步地,所述系统中的HTML5界面可以进行离线缓存,当用户在第一次访问时,后台服务器会根据获取的信息确定要离线本地缓存的资源,动态生成manifest文件,当用户第二次访问的时候manifest文件会控制用户浏览器的的行为,使得在无Internet的情况下访问系统的时候会使用浏览器内部离线的数据,同时后台服务器系统可以根据更新标志来控制是否需要重新生成manifest文件,当新生成的manifest文件和浏览器端的旧manifest文件有变化时,浏览器就会重新进行本地缓存。Further, the HTML5 interface in the system can be cached offline. When the user visits for the first time, the background server will determine the resources to be cached offline and locally according to the obtained information, and dynamically generate a manifest file. When the user visits for the second time The manifest file will control the behavior of the user's browser, so that when accessing the system without the Internet, the offline data inside the browser will be used. At the same time, the background server system can control whether to regenerate the manifest file according to the update flag. When there is a change between the newly generated manifest file and the old manifest file on the browser side, the browser will perform local cache again.

进一步地,根据用户请求信息的种类将信息从数据库中取出填入不同的信息模板中,并在此过程中根据取得的信息确定其在客户端需要离线本地缓存的资源,然后动态生成控制离线缓存的manifest文件。Further, according to the type of information requested by the user, the information is taken out from the database and filled into different information templates, and in the process, according to the acquired information, it is determined that the resources that need to be cached offline and locally on the client side are dynamically generated to control the offline cache manifest file.

进一步地,所述各类数据信息在数据库中以XML的形式导出,加以处理之后变为通用的XML的数据格式,确保可以和其他IETM系统交换数据。Further, the various data information is exported in the form of XML in the database, and after being processed, it becomes a common XML data format, so as to ensure that data can be exchanged with other IETM systems.

本发明中系统主要包括的模块有数据录入界面(网页表单)、后台服务器、数据库服务器、数据显示模块(浏览器)。The modules mainly included in the system of the present invention include a data entry interface (web page form), a background server, a database server, and a data display module (browser).

数据录入界面需要编写校验规则和确定数据类型,将数据类型分为通用结构信息、图解零部件信息、描述性信息、程序性信息、故障信息、维修计划信息、接线信息、人员信息等,这样限制录入数据的格式。The data entry interface needs to write verification rules and determine the data type, and the data type is divided into general structural information, graphical component information, descriptive information, procedural information, fault information, maintenance plan information, wiring information, personnel information, etc., so that Restrict the format of entered data.

输入完成后提交到后台应用服务器,应用服务器将数据处理按照数据类型分别将信息加入对应的数据库的数据表中。After the input is completed, it is submitted to the background application server, and the application server processes the data and adds the information to the data table of the corresponding database according to the data type.

数据库服务器在接收到数据后将数据存入各自对应的数据表中,同时数据库提供了将数据导出为XML数据的功能,直接从表中导出的XML数据经过后台服务器系统处理之后可以作为标准的中性数据格式,和其他IETM系统交换数据,但是在本系统中不会使用改方法。After receiving the data, the database server stores the data in the respective corresponding data tables. At the same time, the database provides the function of exporting the data as XML data. The XML data directly exported from the table can be used as a standard middle-level data after being processed by the background server system. It can exchange data with other IETM systems, but this method will not be used in this system.

当用户A第一次请求数据a时,后台应用服务器根据请求的数据类型,将数据从数据库服务器中取出,因为已经知道了数据的类型,则知道需要离线本地缓存的资源有哪些(例如是图解零部件信息,则需要在本地缓存零部件的工程图、三维模型资源等)。将这些需要本地缓存的资源写入控制离线本地缓存的manifest文件中。再将数据信息转化为JSON格式,填入相应的ejs模板文件中生成HTML5文件。再将HTML5文件发送给请求的用户,用户浏览器在接受到HTML5文件之后发现有manifest链接,再向服务器请求manifest文件,得到manifest之后根据其中的命令下载离线本地缓存的文件。When user A requests data a for the first time, the background application server fetches the data from the database server according to the requested data type. Since the data type is already known, it knows which resources need to be cached offline locally (for example, graphic component information, it is necessary to cache component drawings, 3D model resources, etc. locally). Write these resources that require local caching into the manifest file that controls offline local caching. Then convert the data information into JSON format, fill in the corresponding ejs template file to generate HTML5 file. Then send the HTML5 file to the requesting user. After receiving the HTML5 file, the user's browser finds a manifest link, then requests the manifest file from the server, and downloads the offline local cached file according to the command after obtaining the manifest.

当用户B请求数据a时,后台服务器还是先检查有没有manifest文件,发现有manifest文件之后再检查更新标识(更新标识由管理员用户设定),若不需更新,则直接返回HTML5文件。若需要更新,则以“w+”的方式打开本HTML5文件对应的manifest文件(“w+”表示若有此文件,覆盖之后重新写入,若没有此文件,则创建改文件),重新写入需要离线本地缓存的资源,再将HTML5文件发送给用户,这样控制离线本地缓存的文件就更新过了。When user B requests data a, the background server still checks whether there is a manifest file first, and then checks the update flag after finding the manifest file (the update flag is set by the administrator user), and returns the HTML5 file directly if no update is required. If you need to update, open the manifest file corresponding to this HTML5 file in the form of "w+" ("w+" means that if there is such a file, it will be overwritten and rewritten; if there is no such file, it will be created and modified), and rewriting needs Offline locally cached resources, and then send the HTML5 file to the user, so that the file that controls the offline local cache has been updated.

若此时用户A再次访问数据a是,浏览器先读取本地缓存的资源显示,再获取服务器上的manifest文件,发现manifest文件更新过,则用户A的浏览器重新下载本页面需要离线本地缓存的资源,这样就实现的离线应用的更新。If user A accesses data a again at this time, the browser first reads the resource display in the local cache, and then obtains the manifest file on the server, and finds that the manifest file has been updated, then user A's browser needs to download this page offline and local cache again Resources, so that the update of the offline application is realized.

同时这种实现方法是用户每访问一个页面就离线本地缓存一个页面,不会影响用户的使用,也减少了不必要资源的离线下载。At the same time, this implementation method is to cache a page offline and locally every time the user visits a page, which will not affect the user's use, and also reduce the offline download of unnecessary resources.

有益效果:本发明与现有技术相比,通过采用约定的数据录入格式和数据存储格式,可以可控制数据从数据库表中导出的格式,使它在和其他系统保持标准的兼容性的同时,也能在系统内部直接填入ejs模板,通过信息录入的约定规则,使得信息能够填入预先定制的ejs模板,而不用为每个信息单独编写HTML5文件,大大减少了显示数据的编写时间,同时在为每个文件填入详细的信息的时候会获取到每个信息的具体内容,这样确定每个文件需要离线缓存的内容,使得整个页面会被离线保存到浏览器离线数据中,用户在下次访问的时候既能减少流量消耗,同时在无网络连接的时候也可访问信息,实现了离线访问,解决B/S模型在无网络连接的情况下不能使用的缺陷。Beneficial effects: Compared with the prior art, the present invention can control the format of data exported from the database table by adopting the agreed data entry format and data storage format, so that it can maintain standard compatibility with other systems, It is also possible to directly fill in the ejs template inside the system. Through the agreed rules of information entry, the information can be filled in the pre-customized ejs template instead of writing HTML5 files for each information, which greatly reduces the writing time of display data, and at the same time When filling in detailed information for each file, the specific content of each information will be obtained, so as to determine the content of each file that needs to be cached offline, so that the entire page will be saved offline to the offline data of the browser. It can not only reduce traffic consumption when accessing, but also access information when there is no network connection, realize offline access, and solve the defect that the B/S model cannot be used without network connection.

附图说明Description of drawings

图1是整体系统的示意图;Fig. 1 is the schematic diagram of overall system;

图2是后台服务器接收到浏览器请求后对manifest文件处理流程图;Figure 2 is a flow chart of processing the manifest file after the background server receives the browser request;

图3是录入界面的示意图;Fig. 3 is a schematic diagram of the input interface;

图4为通用的数据模块结构图。Figure 4 is a general data module structure diagram.

具体实施方式Detailed ways

如图1所示,本发明提供一种基于B/S模型的IETM显示数据生成及离线访问控制方法,包括如下步骤:As shown in Figure 1, the present invention provides a kind of IETM display data generation and off-line access control method based on B/S model, comprises the following steps:

1)管理员根据信息类型通过带校验规则的表单录入数据;1) The administrator enters data through a form with verification rules according to the type of information;

2)数据发送到后台服务器经过处理插入数据库:数据库的信息种类和界面的种类需要提前设计,然后编写界面的模板,按照不同的信息类型编写不同的HTML5模板,将获取的信息填入不同的模板,形成访问连接,所述数据库的信息种类按照类型分别分为:通用结构信息、图解零部件信息、描述性信息、程序性信息、故障信息、维修计划信息、接线信息、人员信息等;2) The data is sent to the background server and inserted into the database after processing: the information types of the database and the types of the interface need to be designed in advance, and then the template of the interface is written, and different HTML5 templates are written according to different information types, and the obtained information is filled into different templates , forming an access connection, the information types of the database are divided into: general structure information, graphic parts information, descriptive information, procedural information, fault information, maintenance plan information, wiring information, personnel information, etc. according to types;

3)在用户需要信息时通过查询获取到数据信息,根据信息类型确定需要离线下载的本地缓存资源;3) Obtain data information through query when the user needs information, and determine the local cache resources that need to be downloaded offline according to the type of information;

4)动态生成manifest文件控制离线的本地缓存:系统中的HTML界面可以进行离线缓存,当用户在第一次访问时,后台服务器会根据获取的信息确定要离线本地缓存的资源,动态生成manifest文件,当用户第二次访问的时候manifest文件会控制用户浏览器的的行为,使得在无Internet的情况下访问系统的时候会使用浏览器内部离线的数据,同时后台服务器系统可以根据更新标志来控制是否需要重新生成manifest文件,当新生成的manifest文件和浏览器端的旧manifest文件有变化时,浏览器就会重新进行本地缓存;4) Dynamically generate a manifest file to control offline local caching: the HTML interface in the system can be cached offline. When the user visits for the first time, the background server will determine the resources to be cached offline and locally according to the obtained information, and dynamically generate the manifest file. , when the user visits for the second time, the manifest file will control the behavior of the user's browser, so that the offline data inside the browser will be used when accessing the system without the Internet, and the background server system can be controlled according to the update flag Do you need to regenerate the manifest file? When the newly generated manifest file changes with the old manifest file on the browser side, the browser will re-do the local cache;

5)将获取到的信息转化成JSON格式直接填入到预先定制好的ejs模板中生成HTML5文件;5) Convert the obtained information into JSON format and directly fill it into the pre-customized ejs template to generate HTML5 files;

6)将HTML5文件和manifest文件一同发送给请求的客户端。6) Send the HTML5 file and the manifest file to the requesting client.

当用户A第一次请求数据a时,后台应用服务器根据请求的数据类型,将数据从数据库服务器中取出,因为已经知道了数据的类型,则知道需要离线本地缓存的资源有哪些(例如是图解零部件信息,则需要在本地缓存零部件的工程图、三维模型资源等)。将这些需要本地缓存的资源写入控制离线本地缓存的manifest文件中。再将数据信息转化为JSON格式,填入相应的ejs模板文件中生成HTML5文件。再将HTML5文件发送给请求的用户,用户浏览器在接受到HTML5文件之后发现有manifest链接,再向服务器请求manifest文件,得到manifest之后根据其中的命令下载离线本地缓存的文件。When user A requests data a for the first time, the background application server fetches the data from the database server according to the requested data type. Since the data type is already known, it knows which resources need to be cached offline locally (for example, graphic component information, it is necessary to cache component drawings, 3D model resources, etc. locally). Write these resources that require local caching into the manifest file that controls offline local caching. Then convert the data information into JSON format, fill in the corresponding ejs template file to generate HTML5 file. Then send the HTML5 file to the requesting user. After receiving the HTML5 file, the user's browser finds a manifest link, then requests the manifest file from the server, and downloads the offline local cached file according to the command after obtaining the manifest.

当用户B请求数据a时,后台服务器还是先检查有没有manifest文件,发现有manifest文件之后再检查更新标识(更新标识由管理员用户设定),若不需更新,则直接返回HTML5文件。若需要更新,则以“w+”的方式打开本HTML5文件对应的manifest文件(“w+”表示若有此文件,覆盖之后重新写入,若没有此文件,则创建改文件),重新写入需要离线本地缓存的资源,再将HTML5文件发送给用户,这样控制离线本地缓存的文件就更新过了。When user B requests data a, the background server still checks whether there is a manifest file first, and then checks the update flag after finding the manifest file (the update flag is set by the administrator user), and returns the HTML5 file directly if no update is required. If you need to update, open the manifest file corresponding to this HTML5 file in the form of "w+" ("w+" means that if there is such a file, it will be overwritten and rewritten; if there is no such file, it will be created and modified), and rewriting needs Offline locally cached resources, and then send the HTML5 file to the user, so that the file that controls the offline local cache has been updated.

若此时用户A再次访问数据a是,浏览器先读取本地缓存的资源显示,再获取服务器上的manifest文件,发现manifest文件更新过,则用户A的浏览器重新下载本页面需要离线本地缓存的资源,这样就实现的离线应用的更新。If user A accesses data a again at this time, the browser first reads the resource display in the local cache, and then obtains the manifest file on the server, and finds that the manifest file has been updated, then user A's browser needs to download this page offline and local cache again Resources, so that the update of the offline application is realized.

下面结合附图具体说明怎么在显示数据的生成方面减少HTML模板的编写和实现离线缓存。The following describes in detail how to reduce the writing of HTML templates and realize offline caching in the aspect of generating display data with reference to the accompanying drawings.

本次实施例使用的数据库为mysql,后台服务器是使用nodejs的express框架搭建的。The database used in this embodiment is mysql, and the background server is built using the express framework of nodejs.

如图4所示,首先编写零件类信息通用的信息结构,根据GB/T 24463IETM推荐,通用的数据模块结构,根据图4,编写零件信息录入界面如下图3所示,通过图3对信息输入的校验,使得输入的信息都是符合规则的,信息进入后台服务器,后台服务器将数据处理之后填入数据库,后台处理程序包括将图片存入相应文件夹,并将图片的路径存入数据库。As shown in Figure 4, first write the general information structure of the part information, according to the recommendation of GB/T 24463IETM, the general data module structure, according to Figure 4, write the part information input interface as shown in Figure 3 below, and input the information through Figure 3 The verification makes the input information conform to the rules, the information enters the background server, and the background server fills the data into the database after processing. The background processing program includes storing the picture in the corresponding folder and storing the path of the picture in the database.

当用户通过页面点击获取相应的零件信息时,后台服务器根据HTTP的路径来判断获取信息的类别,以下根据零件类的信息的路径为/parts/part_name为例,当后台获取到路径时,会根据如图2示意的过程处理控制离线下载的manifest文件,其具体的流程如下:When the user clicks on the page to obtain the corresponding part information, the background server judges the type of information obtained according to the path of HTTP. The path of the information of the part type is /parts/part_name as an example. When the path is obtained in the background, it will be based on The process shown in Figure 2 handles and controls the manifest file downloaded offline. The specific process is as follows:

(1)根据part_name后台服务器进行数据库查询,并将查询的结果转成JSON数据格式;(1) Perform database query according to the part_name background server, and convert the query result into JSON data format;

(2)判断是否有离线缓存的控制manifest文件,若没有,则生成manifest文件,在系统的指定文件夹中以“w+”的标志打开文件,“w+”标识表示若没有文件则创建文件,若有则覆盖原文件;(2) Determine whether there is a control manifest file for offline caching, if not, generate a manifest file, open the file with the "w+" sign in the specified folder of the system, the "w+" sign indicates that if there is no file, create a file, if If so, overwrite the original file;

(3)打开manifest文件之后,需要因为每个HTML5文件需要离线下载的图片、视频并不是确定的,需要知道从数据库返回的的资源中哪些是图片、视频文件,因为提前控制了录入数据的格式,所以可以根据不同的信息类型知道要包含进manifest文件中的资源,就可以根据这些信息动态的为每个manifest文件写入要离线下载的资源。(3) After opening the manifest file, you need to know which of the resources returned from the database are pictures and video files, because the pictures and videos that need to be downloaded offline for each HTML5 file are not certain, because the format of the input data is controlled in advance , so the resources to be included in the manifest file can be known according to different information types, and the resources to be downloaded offline can be dynamically written for each manifest file according to the information.

(4)要若是manifest文件已经存在,则根据系统的标志判断是否需要更新来对manifest文件进行更新,最后得到需要的目标manifest文件,通过manifest文件就可以对浏览器内的离线资源进行控制,即使删除了浏览器缓存也不会对离线文件造成影响。(4) If the manifest file already exists, update the manifest file by judging whether it needs to be updated according to the system logo, and finally get the required target manifest file. The offline resources in the browser can be controlled through the manifest file, even if Deleting the browser cache will not affect offline files.

当离线下载控制文件生成好了之后,就是对HTML模板的生成了,本方法采用ejs模板的语法为每个文件编写模板,在后台服务器渲染ejs的零件模板时将JSON格式的数据填入其中。下面的代码为生成零件的HTML格式数据的ejs模板:After the offline download control file is generated, the HTML template is generated. This method uses the syntax of the ejs template to write a template for each file, and fills in the data in JSON format when the background server renders the ejs part template. The following code is the ejs template that generates the HTML format data of the part:

本发明的实质是预先将信息进行分类,并确定每一类信息将要包含的具体内容,然后控制每一类信息输入格式,使得在生成显示数据的时候可以确定需要离线下载的图片等多媒体资源,然后动态的生成manifest文件用以控制需要离线本地缓存的文件。在manifest文件生成之后再将信息填入事先编写好的ejs模板文件中,后台服务器编译ejs模板文件生成HTML5文件之后将其发送给浏览器,使得用户在第一次访问之后就可以实现离线访问数据了,同时因为HTML5文件是由事先编写的ejs模板生成的,可以大大减少发布数据的编写。总体来说,本发明在用模板生成HTML5的发布数据同时动态为每个HTML5文件生成manifest文件,提高的发布数据生成的效率,提升了用户使用体验,实现了B/S模型下的离线访问。The essence of the present invention is to classify information in advance, and determine the specific content to be contained in each type of information, and then control the input format of each type of information, so that multimedia resources such as pictures that need to be downloaded offline can be determined when generating display data. Then dynamically generate the manifest file to control the files that need to be cached offline and locally. After the manifest file is generated, fill in the information into the pre-written ejs template file, and the background server compiles the ejs template file to generate an HTML5 file and sends it to the browser, so that users can access data offline after the first visit At the same time, because the HTML5 file is generated by the pre-written ejs template, the writing of publishing data can be greatly reduced. In general, the present invention dynamically generates a manifest file for each HTML5 file while using a template to generate HTML5 release data, improves the efficiency of release data generation, improves user experience, and realizes offline access under the B/S model.

Claims (5)

1. the IETM display datas based on B/S models generate and offline access control method, it is characterised in that:Including walking as follows Suddenly:
1) administrator passes through the list logging data of tape verifying rule according to information type;
2) data are sent to background server and are inserted into database by processing;
3) data information is got by inquiry when user needs information, the sheet for needing to download offline is determined according to information type Ground cache resources;
4) the offline local cache of dynamic generation manifest document controls;
5) information got is converted to JSON formats and is directly filled into generation HTML5 texts in the ejs templates customized in advance Part;
6) HTML5 files and manifest files are sent to the client of request together.
2. the IETM display datas according to claim 1 based on B/S models generate and offline access control method, special Sign is:The information category of database and the type at interface need designed in advance in the step 2), then write the mould at interface Plate writes different ejs templates according to different information types, and the information of acquisition is inserted to different templates, forms the company of access It connects.
3. the IETM display datas according to claim 2 based on B/S models generate and offline access control method, special Sign is:The information category of the database is respectively divided into according to type:Universal architecture information, diagram components information, description Property information, procedural information, fault message, maintenance project information, wiring information, personal information.
4. the IETM display datas according to claim 1 based on B/S models generate and offline access control method, special Sign is:The interfaces HTML5 in the system can carry out offline cache, when user is in first time access, background server It can determine that the resource for wanting offline local cache, dynamic generation manifest files are visited for second as user according to the information of acquisition Manifest files can control the behavior of user browser when asking so that access system in the case of no Internet When can use offline data inside browser, while background server system can be controlled whether according to update mark It needs to regenerate manifest files, when the old manifest files of newly-generated manifest files and browser end have change When change, browser will re-start local cache.
5. the IETM display datas according to claim 2 based on B/S models generate and offline access control method, special Sign is:Information is inserted from taking-up in database in different information models according to the type of user request information, and herein Determine that it needs in client the resource of offline local cache according to the information of acquirement in the process, then dynamic generation control is offline The manifest files of caching.
CN201810105293.8A 2018-02-02 2018-02-02 IETM display datas based on B/S models generate and Off-line control method Pending CN108363760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810105293.8A CN108363760A (en) 2018-02-02 2018-02-02 IETM display datas based on B/S models generate and Off-line control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810105293.8A CN108363760A (en) 2018-02-02 2018-02-02 IETM display datas based on B/S models generate and Off-line control method

Publications (1)

Publication Number Publication Date
CN108363760A true CN108363760A (en) 2018-08-03

Family

ID=63004357

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810105293.8A Pending CN108363760A (en) 2018-02-02 2018-02-02 IETM display datas based on B/S models generate and Off-line control method

Country Status (1)

Country Link
CN (1) CN108363760A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101520A (en) * 2018-06-12 2018-12-28 中车青岛四方机车车辆股份有限公司 A kind of display methods of electronic documentation and electronic documentation
CN111367519A (en) * 2018-12-26 2020-07-03 北京奇虎科技有限公司 Page part using method and device, computing equipment and computer storage medium
CN112181684A (en) * 2020-09-27 2021-01-05 北京金和网络股份有限公司 Method, device and system for operating Web form based on native end
CN112270475A (en) * 2020-10-29 2021-01-26 中国北方工业有限公司 Information platform system integrated by built equipment system
CN112699641A (en) * 2021-03-25 2021-04-23 南京国睿信维软件有限公司 Method for quickly converting batch copy of WORD content to DM based on S1000D standard

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779128A (en) * 2011-05-10 2012-11-14 北京磊友信息科技有限公司 Method and device for offline running of HTML5 (hypertext markup language 5) application program in mobile terminal
KR20130029926A (en) * 2011-09-16 2013-03-26 엔에이치엔(주) System and method for installing web application
CN103324517A (en) * 2012-03-20 2013-09-25 华为终端有限公司 Off-line application generation and call method, terminal and system
CN103747084A (en) * 2014-01-08 2014-04-23 广东电网公司信息中心 Off-line access method and system for advanced enterprise mobile application platform
CN104156347A (en) * 2014-08-11 2014-11-19 中国人民解放军军械工程学院 IETM illustrated part data entry device and method based on templates
US20150058435A1 (en) * 2013-08-21 2015-02-26 International Business Machines Corporation Fast Mobile Web Applications Using Cloud Caching
CN105808595A (en) * 2014-12-31 2016-07-27 北京航天测控技术有限公司 Database generation method and device of specification file

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102779128A (en) * 2011-05-10 2012-11-14 北京磊友信息科技有限公司 Method and device for offline running of HTML5 (hypertext markup language 5) application program in mobile terminal
KR20130029926A (en) * 2011-09-16 2013-03-26 엔에이치엔(주) System and method for installing web application
CN103324517A (en) * 2012-03-20 2013-09-25 华为终端有限公司 Off-line application generation and call method, terminal and system
US20150058435A1 (en) * 2013-08-21 2015-02-26 International Business Machines Corporation Fast Mobile Web Applications Using Cloud Caching
CN103747084A (en) * 2014-01-08 2014-04-23 广东电网公司信息中心 Off-line access method and system for advanced enterprise mobile application platform
CN104156347A (en) * 2014-08-11 2014-11-19 中国人民解放军军械工程学院 IETM illustrated part data entry device and method based on templates
CN105808595A (en) * 2014-12-31 2016-07-27 北京航天测控技术有限公司 Database generation method and device of specification file

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
AIGUO LI: "The research of PMA-based IETM system under B/S model", 《IEEE》 *
明日科技: "《HTML5从入门到精通》", 30 June 2017 *
贾岩等: "HTML5应用程序缓存中毒攻击研究", 《通信学报》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101520A (en) * 2018-06-12 2018-12-28 中车青岛四方机车车辆股份有限公司 A kind of display methods of electronic documentation and electronic documentation
CN111367519A (en) * 2018-12-26 2020-07-03 北京奇虎科技有限公司 Page part using method and device, computing equipment and computer storage medium
CN111367519B (en) * 2018-12-26 2024-03-01 北京奇虎科技有限公司 Page part using method and device, computing equipment and computer storage medium
CN112181684A (en) * 2020-09-27 2021-01-05 北京金和网络股份有限公司 Method, device and system for operating Web form based on native end
CN112270475A (en) * 2020-10-29 2021-01-26 中国北方工业有限公司 Information platform system integrated by built equipment system
CN112699641A (en) * 2021-03-25 2021-04-23 南京国睿信维软件有限公司 Method for quickly converting batch copy of WORD content to DM based on S1000D standard
CN112699641B (en) * 2021-03-25 2021-07-20 南京国睿信维软件有限公司 Method for quickly converting batch copy of WORD content to DM based on S1000D standard

Similar Documents

Publication Publication Date Title
US12355854B2 (en) Configurable and dynamic transformation of web content
CN108363760A (en) IETM display datas based on B/S models generate and Off-line control method
US8082539B1 (en) System and method for managing web-based forms and dynamic content of website
CN100591078C (en) A website caching method and a website caching device
US7685168B2 (en) Removing web application flicker using AJAX and page templates
AU2016302371B2 (en) Building and managing data-processing attributes for modeled data sources
CN109388766B (en) Page loading method and device
CN106155673B (en) Method, device, server and user equipment for realizing page content editor
CN106055337B (en) An interface generation method and device
WO2016026384A1 (en) Client page display method, device and system
US20070106946A1 (en) Method and system for developing interactive Web applications in a unified framework
CN104714982A (en) Method and system for loading webpage
US20100131585A1 (en) Displaying information in a client/server system
CN103312803B (en) Optimization method and device are experienced in a kind of web access
JP2009531793A (en) System and method for converting web community and web application data
US20110161847A1 (en) System and method for integrating and publishing pages of content
WO2016024987A1 (en) Web-intrinsic interactive documents
EP2748711A1 (en) Data infrastructure for providing interconnectivity between platforms, devices, and operating systems
CN115776516B (en) Page refreshing method and device and electronic equipment
JP2009524132A (en) Method and system for integrating computing and presentation techniques
CN103034496B (en) Based on the Locally-static portal generation method of template
US10742764B2 (en) Web page generation system
WO2020013724A1 (en) Method of managing website data
WO2020215833A1 (en) Offline cache method and apparatus, and terminal and readable storage medium
US9734160B1 (en) Virtual file system for hosted network sites

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20180803

RJ01 Rejection of invention patent application after publication