CN111159099B - Online data generation method and device, electronic equipment and storage medium - Google Patents

Online data generation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111159099B
CN111159099B CN201911118340.3A CN201911118340A CN111159099B CN 111159099 B CN111159099 B CN 111159099B CN 201911118340 A CN201911118340 A CN 201911118340A CN 111159099 B CN111159099 B CN 111159099B
Authority
CN
China
Prior art keywords
file
preset
target
directory
document
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.)
Active
Application number
CN201911118340.3A
Other languages
Chinese (zh)
Other versions
CN111159099A (en
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.)
Hangzhou Dt Dream Technology Co Ltd
Original Assignee
Hangzhou Dt Dream Technology Co Ltd
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 Hangzhou Dt Dream Technology Co Ltd filed Critical Hangzhou Dt Dream Technology Co Ltd
Priority to CN201911118340.3A priority Critical patent/CN111159099B/en
Publication of CN111159099A publication Critical patent/CN111159099A/en
Application granted granted Critical
Publication of CN111159099B publication Critical patent/CN111159099B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/116Details of conversion of file system types or formats
    • 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]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application provides an online data generation method, an online data generation device, electronic equipment and a storage medium, wherein the online data generation method comprises the following steps: operating a preset plug-in tool to acquire a file to be converted from a target directory; converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position; and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document. Therefore, the technical problems of complex document downloading operation, inconsistent formats and low online document generation efficiency in the prior art are solved, the file to be converted is obtained from the target directory and stored according to the target format by operating the preset plug-in tool, so that the file in the target format is converted and generated by operating the preset command line tool, the operation is simple, the document generation efficiency is improved, and the user requirements are met.

Description

Online data generation method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of data processing technologies, and in particular, to an online data generating method, an online data generating device, an electronic device, and a storage medium.
Background
Typically, the data engineer outputs a job to conflux (enterprise knowledge management and collaboration software), and outputs an offline manual based on the conflux function, and the material delivery only has the offline manual, which does not meet the strict delivery requirements.
At present, only a document manual of a product or an offline manual delivered by a query material engineer can be queried on the conflux, or the document format of the downloaded document on the conflux is often larger in and out than that of the document on the conflux, a worker is required to manually adjust the format after downloading, a great deal of time is occupied, the document on the conflux is clicked once for downloading every page, and when a great number of documents need to be downloaded, a great deal of operations are required to be executed to download all the pages.
Content of the application
The present application aims to solve at least one of the technical problems in the related art described above to some extent.
Therefore, a first object of the present application is to provide an online data generating method, which solves the technical problems of complicated document downloading operation, inconsistent formats and low online document generating efficiency in the prior art, and obtains a file to be converted from a target directory and stores the file according to a target format by operating a preset plug-in tool, so as to operate a preset command line tool to convert the file in the target format to generate an online document, and has the advantages of simple operation, improved document generating efficiency and satisfaction of user requirements.
A second object of the present application is to provide an online data generating apparatus.
A third object of the application is to propose a computer device.
A fourth object of the present application is to propose a non-transitory computer readable storage medium.
To achieve the above object, an embodiment of a first aspect of the present application provides an online data generating method, including: operating a preset plug-in tool to acquire a file to be converted from a target directory; converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position; and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document.
In addition, the online data generation method of the embodiment of the application also has the following additional technical characteristics:
optionally, before the running preset plug-in tool obtains the file to be converted from the target directory, the method further includes: acquiring a root directory node of the file to be converted; and determining the target directory according to the root directory node.
Optionally, the running a preset command line tool includes: determining a preset storage position; and running the preset command line tool in a storage catalog corresponding to the preset storage position.
Optionally, running a preset plug-in tool in the target directory to obtain the file to be converted includes: traversing the document object model of the target directory, expanding all nodes under the target directory node, and obtaining the whole target directory file link; acquiring a text link in the whole target directory file link, and acquiring the content of the hypertext markup language document according to the text link; acquiring a picture link in the whole target directory file link, acquiring picture content according to the picture link, splicing the picture content to a corresponding position in the hypertext markup language document content, and generating the document to be converted; and performing splicing processing on each page directory identifier in the document object model to generate a directory webpage structure, and generating the file to be converted according to the file to be converted and the directory webpage structure.
Optionally, after acquiring the picture content according to the picture link, the method further includes: converting the picture content according to a preset picture format to generate a picture with a target format; splicing the picture content to a corresponding position in the hypertext markup language document content to generate the document to be converted, including: and splicing the target format picture to a corresponding position in the content of the hypertext markup language document to generate the document to be converted.
Optionally, the running a preset command line tool performs online conversion on the target format file in the preset downloading position to generate an online document, which includes: running the preset command line tool starting command, acquiring a target position, copying a configuration file stored in the preset command line tool into the target position, and simultaneously transmitting a path of the preset downloading position downwards; copying the target format file to the target position according to the path of the preset downloading position; and executing a online conversion tool to convert the target format file into the online document.
To achieve the above object, an embodiment of a second aspect of the present application provides an online data generating device, including: the first acquisition module is used for operating a preset plug-in tool to acquire a file to be converted from the target directory; the conversion downloading module is used for converting the file to be converted according to a preset format to generate a target format file and downloading the target format file to a preset downloading position; the operation module is used for operating a preset command line tool; and the processing module is used for carrying out online conversion on the target format file in the preset downloading position to generate an online document.
In addition, the online data generating device of the embodiment of the application also has the following additional technical characteristics:
optionally, the apparatus further comprises: the second acquisition module is used for acquiring the root directory node of the file to be converted; and the determining module is used for determining the target directory according to the root directory node.
Optionally, the operation module is specifically configured to: determining a preset storage position; and running the preset command line tool in a storage catalog corresponding to the preset storage position.
Optionally, the first obtaining module is specifically configured to: traversing the document object model of the target directory, expanding all nodes under the target directory node, and obtaining the whole target directory file link; acquiring a text link in the whole target directory file link, and acquiring the content of the hypertext markup language document according to the text link; acquiring a picture link in the whole target directory file link, acquiring picture content according to the picture link, splicing the picture content to a corresponding position in the hypertext markup language document content, and generating the document to be converted; and performing splicing processing on each page directory identifier in the document object model to generate a directory webpage structure, and generating the file to be converted according to the file to be converted and the directory webpage structure.
Optionally, after acquiring the picture content according to the picture link, the method further includes: converting the picture content according to a preset picture format to generate a picture with a target format; splicing the picture content to a corresponding position in the hypertext markup language document content to generate the document to be converted, including: and splicing the target format picture to a corresponding position in the content of the hypertext markup language document to generate the document to be converted.
Optionally, the processing module is specifically configured to: acquiring a target position, copying a configuration file stored in the preset command line tool into the target position, and simultaneously transmitting a path of the preset downloading position downwards; copying the target format file to the target position according to the path of the preset downloading position; and executing a online conversion tool to convert the target format file into the online document.
To achieve the above object, an embodiment of a third aspect of the present application provides a computer apparatus, including: a processor and a memory; wherein the processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory for implementing the online data generation method as described in the embodiment of the first aspect.
To achieve the above object, an embodiment of a fourth aspect of the present application proposes a non-transitory computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements an online data generation method according to the embodiment of the first aspect.
To achieve the above object, an embodiment of a fifth aspect of the present application proposes a computer program product implementing an online data generation method according to the embodiment of the first aspect, when instructions in the computer program product are executed by a processor.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
operating a preset plug-in tool to acquire a file to be converted from a target directory; converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position; and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document. Therefore, the technical problems of complex document downloading operation, inconsistent formats and low online document generation efficiency in the prior art are solved, the file to be converted is obtained from the target directory and stored according to the target format by operating the preset plug-in tool, so that the file in the target format is converted and generated by operating the preset command line tool, the operation is simple, the document generation efficiency is improved, and the user requirements are met.
Additional aspects and advantages of the application will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the application.
Drawings
The foregoing and/or additional aspects and advantages of the application will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings, in which:
FIG. 1 is a flow chart of an online data generation method according to one embodiment of the application;
FIG. 2 is a flow chart of an online data generation method according to another embodiment of the application;
FIG. 3 is a flow chart of an online data generation method according to yet another embodiment of the present application;
FIG. 4 is a flow chart of an online data generation method according to yet another embodiment of the present application;
FIG. 5 is a flow chart of an online data generation method according to yet another embodiment of the present application;
FIG. 6 is a schematic diagram of an online data generating apparatus according to one embodiment of the present application;
fig. 7 is a schematic structural view of an online data generating apparatus according to another embodiment of the present application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative and intended to explain the present application and should not be construed as limiting the application.
An online data generating method, apparatus, electronic device, and storage medium according to embodiments of the present application are described below with reference to the accompanying drawings.
Aiming at the technical problems of complicated document downloading operation, inconsistent formats and lower online document generation efficiency in the prior art, the application provides an online data generation method, which comprises the steps of running a preset plug-in tool to acquire a file to be converted from a target directory; converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position; and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document. Therefore, the file to be converted is obtained by operating the preset plug-in tool on the target directory and is stored according to the target format, so that the operation of converting the target format file into the online document by operating the preset command line tool is simple, the document generation efficiency is improved, and the user requirements are met.
Specifically, fig. 1 is a flowchart of an online data generation method according to an embodiment of the present application, as shown in fig. 1, the method includes:
and step 101, running a preset plug-in tool to acquire the file to be converted from the target directory.
Step 102, converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position.
In practical applications, in the embodiment of the present application, related preprocessing needs to be performed according to the formats of the preset plugin tool and the preset command line tool, for example, the preset command line tool is a npm (packet management tool) packet, and before the preset plugin tool is executed, for example, the google plugin tool, commands such as' npm config set registry are executed under cmd (running command prompt) command linehttp://npm.dt-reta.tech/' switch npm warehouse address to npm source.
It can be understood that which files are selected to generate the online document according to the actual application needs, so that a preset downloading position, that is, the downloaded file position is determined, a root directory node of the whole directory to be downloaded is selected, a preset plug-in tool is executed to download, and the preset plug-in tool automatically converts all files of the target directory corresponding to the root directory node into a target format, such as a markdown format, and downloads the files to the preset downloading position, such as a C2M folder in batches.
It should be noted that, there are various ways of operating the preset plug-in tool to obtain the file to be converted from the target directory, and as an example, traversing the document object model of the target directory, expanding all nodes under the target directory node, and obtaining the whole target directory file link; acquiring text links in the whole target directory file links, and acquiring the contents of the hypertext markup language documents according to the text links; acquiring a picture link in the whole target directory file link, acquiring picture content according to the picture link, splicing the picture content to a corresponding position in the hypertext markup language document content, and generating a document to be converted; and splicing all page directory identifications in the document object model to generate a directory webpage structure, and generating a file to be converted according to the document to be converted and the directory webpage structure.
And 103, running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document.
Specifically, if the online document is generated as a submission, or only the effect of generating the online document is known, the online document may be generated by running a preset command line tool, such as executing a specified command of the cli command line tool, after running the command prompt at an arbitrary position.
It can be further understood that if the online document is generated as an online manual of the product, a preset storage position needs to be determined, and a preset command line tool is operated in a storage catalog corresponding to the preset storage position, so that the online document can be stored in the preset storage position according to the user requirement, and the user requirement is met.
Specifically, there are many ways of running a preset command line tool to perform online conversion on a target format file in a preset downloading position, and as one possible implementation way, running a preset command line tool start command to obtain a target position, copying a configuration file stored in the preset command line tool to the target position, simultaneously transferring a path of the preset downloading position downwards, copying the target format file to the target position according to the path of the preset downloading position, and executing the online conversion tool to convert the target format file to the online document.
In summary, according to the online document generation method provided by the embodiment of the application, a preset plug-in tool is operated to acquire a file to be converted from a target directory; converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position; and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document. Therefore, the technical problems of complex document downloading operation, inconsistent formats and low online document generation efficiency in the prior art are solved, the file to be converted is obtained from the target directory and stored according to the target format by operating the preset plug-in tool, so that the file in the target format is converted and generated by operating the preset command line tool, the operation is simple, the document generation efficiency is improved, and the user requirements are met.
FIG. 2 is a flow chart of an online data generation method according to another embodiment of the present application, as shown in FIG. 2, the method comprising:
step 201, obtaining a root directory node of a file to be converted, and determining a target directory according to the root directory node.
Specifically, a root directory node of the whole directory to be downloaded is selected, and a target directory is determined according to the root directory node.
Step 202, traversing the document object model of the target directory, and expanding all nodes under the target directory node to obtain the whole target directory file link.
And 203, acquiring text links in the whole target directory file link, and acquiring the content of the hypertext markup language document according to the text links.
Step 204, obtaining the picture link in the whole target directory file link, obtaining the picture content according to the picture link, splicing the picture content to the corresponding position in the hypertext markup language document content, and generating the document to be converted.
And 205, performing splicing processing on each page directory identifier in the document object model to generate a directory webpage structure, and generating a file to be converted according to the file to be converted and the directory webpage structure.
Specifically, a Document Object Model (DOM) of the target directory is traversed, all child nodes under the target directory node are unfolded, so that the whole target directory file link is obtained, and the document object model is utilized to carry out operations of address modification, complete html structure splicing and the like, and is used as a directory file of the set of documents.
It should be noted that, after obtaining the picture content according to the picture link, the method further includes: converting the picture content according to a preset picture format to generate a picture with a target format; splicing the picture content to a corresponding position in the hypertext markup language document content to generate a document to be converted, comprising: and splicing the target format picture to a corresponding position in the content of the hypertext markup language document to generate a document to be converted. The preset picture format can be selected and set according to actual application requirements.
Therefore, the picture links and the picture names are uniformly stored, all picture addresses are requested, a request result is converted into a preset picture format such as a base64 format and then spliced back into an original document, so that the picture is not dependent on external introduction, all base64 pictures are spliced back to corresponding positions in the document, in order to further improve the document quality, a processed file to be converted can be intercepted, content such as a useless navigation menu is deleted, a npm conversion format packet is used for carrying out preliminary conversion of the document format and converting the primary conversion into a target format file in a mark down format, partial modification is carried out on the existing npm packet, redundant empty line deletion, special symbol processing, redundant indentation processing and the like are carried out on the converted target format file, and the target format file is downloaded to obtain a preset downloading position after the processing is completed.
More specifically, as shown in fig. 3, 1, positioning the position of a root directory node of a set of documents to be downloaded in a directory tree in a page, acquiring DOM object data, and transmitting the DOM object data downwards; 2. traversing the obtained DOM object structure, if sub pages exist, expanding the catalog of the DOM object structure (if the sub pages are not expanded, the link addresses of all pages in the set of documents cannot be obtained), and transmitting the link addresses of all pages and the page catalog identification id of the current root node page downwards; 3. the catalog DOM of the current set of documents is obtained by using the transmitted page catalog id, and is spliced into a complete html structure (the purpose is to process and convert with all page contents), and the catalog contents are stored in an array and are transmitted downwards together with links of all pages transmitted above.
4. Requesting all page links transmitted above, storing page content (content information of a document, namely, backbone content, which does not contain contents such as catalogues and toolbars) into a content array transmitted above, and transmitting the page content downwards; 5. traversing the content array transferred above, extracting and storing the picture address and the picture name in each page into the picture array, and transferring the page content array and the picture array downwards together; 6. requesting each picture in the picture array transferred above, converting the returned picture content into a base64 format (converting into the base64 format to store the picture in a page without introducing the picture from outside), storing the picture in the base64 format in a corresponding position of the picture array, and transferring the picture array storing the picture in the base64 format and the content array downwards together; 7. traversing the two arrays (page content array and picture array) transferred above, matching the original position of the picture in the page according to the name of each picture in the picture array, splicing the picture in the base64 format back to the original position (after finding the original position in the page according to the picture name, replacing the address character string of the picture with the base64 code, wherein the address is also unique and used as the storage position of the base64 code), and transferring the content array of the spliced picture in the base64 format downwards; 8. using an open source npm format conversion packet to convert each page in the content array into a markdown format, and transmitting the content array processed into the markdown format downwards; 9. the method comprises the steps of deleting redundant empty lines, reducing redundant indents, converting special symbols and the like on a primarily processed markdown format file, and transmitting processed page contents in the markdown format downwards; and downloading the processed content into a markdown file, namely a target format file.
Step 206, determining a preset storage position, and running a preset command line tool in a storage catalog corresponding to the preset storage position.
Specifically, the preset storage location may be selected according to a user's need, for example, only an online document is needed as a submitted product, or only a conversion effect is needed to be checked to generate an online document effect, etc., then only a preset command line tool is needed to be operated after a command prompt is operated at any location, if online product issue is needed, a target storage location is needed to be selected, and a preset command line tool is needed to be operated after a command prompt is operated in a storage directory corresponding to the preset storage location.
Step 207, obtaining the target location, copying the configuration file stored in the preset command line tool into the target location, and simultaneously transmitting the path of the preset download location downwards.
And step 208, copying the target format file to the target position according to the path of the preset downloading position, and executing the online conversion tool to convert the target format file into an online document.
Specifically, storing the gitbook configuration file in a preset command line tool, such as a cli command line tool, may specify the target location of the gitbook issue document by receiving parameters when executing the cli tool start command.
It should be noted that, it is necessary to determine the type of the operating system, and execute, for example, a bat script to automatically modify the gitbook configuration file, so that the gitbook is not affected by the antivirus software.
For example, as shown in FIG. 4, after downloading the cli command line tool installed, executing a start command (the start command is preset and agreed) in the cmd command line window; 2. the cli command line tool prompts a user to input a preset downloading position of the google plug-in tool, detects whether a path of the preset downloading position is correct after receiving the input of the preset downloading position, and comprises the steps of judging whether the path of the preset downloading position exists, judging whether the path is the preset downloading position or not, judging whether the path contains a mark down format file downloaded by the google plug-in tool, namely a target format file, and transmitting the path of the mark down file downwards; 3. the cli command line tool automatically copies the configuration files required by the gitbook, namely, the configuration files are stored in the cli command line tool in advance, after a starting command is executed, the configuration files stored in the cli tool are copied to a target position such as a user computer, and meanwhile, the path of the markdown file is downwards transmitted; 4. copying all downloaded markdown files to a default public directory according to the path of the transmitted markdown files, or adding a parameter appointed position when a user executes a starting command in the first step; 5. executing a command to install a gitbook; 6. judging the current operating system, if the current operating system is a Windows system, modifying the configuration file of the gitbook, otherwise, the antivirus software may influence the normal starting of the gitbook, and running a preset bat script file; 7. after all the steps are finished, automatically executing a starting command of the gitbook, wherein the gitbook can linearly convert all markdown files downloaded by the google plug-in tool into online documents; 8. after the startup is completed, the cli command line tool automatically opens the browser to display the converted effect.
In summary, the online data generating method of the embodiment of the application obtains the root directory node of the file to be converted, determines the target directory according to the root directory node, traverses the document object model of the target directory, expands all nodes under the target directory node, obtains the file link in the whole target directory file link, obtains the text link in the whole target directory file link, obtains the hypertext markup language document content according to the text link, obtains the picture link in the whole target directory file link, obtains the picture content according to the picture link, splices the picture content to the corresponding position in the hypertext markup language document content to generate the file to be converted, splices each page directory identifier in the document object model, generates the directory webpage structure, generates the file to be converted according to the file to be converted and the directory webpage structure, determines the preset storage position, operates the preset command line tool in the storage directory corresponding to the preset storage position, obtains the target position, copies the configuration file stored in the preset command line tool to the target position, simultaneously transfers the path of the preset downloading position downwards, copies the target file to the target position according to the path of the preset downloading position, and converts the target file to the online command line format into the online command format. Therefore, the technical problems of complex document downloading operation, inconsistent formats and low online document generation efficiency in the prior art are solved, the file to be converted is obtained from the target directory and stored according to the target format by operating the preset plug-in tool, so that the file in the target format is converted and generated by operating the preset command line tool, the operation is simple, the document generation efficiency is improved, and the user requirements are met.
To more clearly describe the above process, the following details are described in conjunction with fig. 5, and as shown in fig. 5, includes:
1.1, installing google plug-in tools; 1.2, installing cli command line tools; 2.1, after the installation is completed, finding the position of the document to be converted and downloaded on the conflux, obtaining the root directory node of the whole downloaded directory, and running a google plug-in tool for downloading, wherein the google plug-in tool can automatically convert all files of the target directory into a markdown format and download C2M folders in the google downloading position in batches.
3.1, if the downloaded target format file is used as an online manual of a product, acquiring a catalog where the static file is distributed, and opening a cmd command line; 3.2 if the downloaded file is only used as a delivery product or only a down conversion effect is checked, the cmd command line only needs to be run at any position; 4.1 executing the specified command of the cli command line tool in the cmd command line running above, and then executing the gitbook start command according to the absolute address of the target format file received 2.1 download.
5.1, after the steps are finished, automatically opening the operated website, and checking whether the effect of converting and releasing the online document can be accepted, whether improvement is needed or not and the like by setting preset requirements, manual modes and the like; 6.1 if the checking result meets the preset requirement, and meanwhile, the downloaded online document is used as an online manual of the product, all documents are required to be placed under a static file release catalog of the product project, and the changes are submitted to a code warehouse.
Therefore, the technical problems of complex document downloading operation, inconsistent formats and low online document generation efficiency in the prior art are solved, the file to be converted is obtained from the target directory and stored according to the target format by operating the preset plug-in tool, so that the file in the target format is converted and generated by operating the preset command line tool, the operation is simple, the document generation efficiency is improved, and the user requirements are met.
In order to achieve the above embodiment, the present application further provides an online data generating device. Fig. 6 is a schematic structural view of an online data generating apparatus according to an embodiment of the present application, as shown in fig. 6, the online data generating apparatus comprising: a first acquisition module 601, a conversion download module 602, a run module 603, and a processing module 604, wherein,
the first obtaining module 601 is configured to operate a preset plug-in tool to obtain a file to be converted from the target directory.
The conversion downloading module 602 is configured to convert the file to be converted according to a preset format to generate a target format file, and download the target format file to a preset downloading position.
An operation module 603, configured to operate a preset command line tool.
And the processing module 604 is used for converting the target format file in the preset downloading position to generate an online document.
In one embodiment of the present application, as shown in fig. 7, on the basis of fig. 6, the apparatus further includes: a second acquisition module 605 and a determination module 606.
A second obtaining module 605 is configured to obtain a root directory node of the file to be converted.
A determining module 606, configured to determine the target directory according to the root directory node.
In one embodiment of the present application, the operation module 603 is specifically configured to: determining a preset storage position; and running the preset command line tool in a storage catalog corresponding to the preset storage position.
In one embodiment of the present application, the first obtaining module 601 is specifically configured to: traversing the document object model of the target directory, expanding all nodes under the target directory node, and obtaining the whole target directory file link; acquiring a text link in the whole target directory file link, and acquiring the content of the hypertext markup language document according to the text link; acquiring a picture link in the whole target directory file link, acquiring picture content according to the picture link, splicing the picture content to a corresponding position in the hypertext markup language document content, and generating the document to be converted; and performing splicing processing on each page directory identifier in the document object model to generate a directory webpage structure, and generating the file to be converted according to the file to be converted and the directory webpage structure.
In one embodiment of the present application, the processing module 604 is specifically configured to: the method comprises the steps of obtaining a target position, copying a configuration file stored in the preset command line tool into the target position, and transmitting a path of a preset downloading position downwards; copying the target format file to a target position according to a path of a preset downloading position; and executing a online conversion tool to convert the target format file into the online document.
It should be noted that the foregoing explanation of the embodiment of the online data generating method is also applicable to the online data generating device of this embodiment, and will not be repeated herein.
In summary, the online data generating device of the embodiment of the application operates a preset plug-in tool to acquire a file to be converted from a target directory; converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position; and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document. Therefore, the technical problems of complex document downloading operation, inconsistent formats and low online document generation efficiency in the prior art are solved, the file to be converted is obtained from the target directory by operating the preset plug-in tool and is stored according to the target format, and the preset command line tool is executed to convert the file in the target format to generate the online document, so that the operation is simple, the document generation efficiency is improved, and the user requirements are met.
In order to implement the above embodiment, the present application further proposes a computer device including a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the online data generation method as described in the above embodiment when executing the computer program.
In order to achieve the above-described embodiments, the present application also proposes a non-transitory computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements an online data generation method as described in the foregoing method embodiments.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
Furthermore, the terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In the description of the present application, the meaning of "plurality" means at least two, for example, two, three, etc., unless specifically defined otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and additional implementations are included within the scope of the preferred embodiment of the present application in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order from that shown or discussed, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the embodiments of the present application.
Logic and/or steps represented in the flowcharts or otherwise described herein, e.g., a ordered listing of executable instructions for implementing logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner, if necessary, and then stored in a computer memory.
It is to be understood that portions of the present application may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. As with the other embodiments, if implemented in hardware, may be implemented using any one or combination of the following techniques, as is well known in the art: discrete logic circuits having logic gates for implementing logic functions on data signals, application specific integrated circuits having suitable combinational logic gates, programmable Gate Arrays (PGAs), field Programmable Gate Arrays (FPGAs), and the like.
Those of ordinary skill in the art will appreciate that all or a portion of the steps carried out in the method of the above-described embodiments may be implemented by a program to instruct related hardware, where the program may be stored in a computer readable storage medium, and where the program, when executed, includes one or a combination of the steps of the method embodiments.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing module, or each unit may exist alone physically, or two or more units may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules. The integrated modules may also be stored in a computer readable storage medium if implemented in the form of software functional modules and sold or used as a stand-alone product.
The above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, or the like. While embodiments of the present application have been shown and described above, it will be understood that the above embodiments are illustrative and not to be construed as limiting the application, and that variations, modifications, alternatives and variations may be made to the above embodiments by one of ordinary skill in the art within the scope of the application.

Claims (14)

1. An online data generation method, comprising:
running a preset plug-in tool to obtain a file to be converted from a target directory, wherein text links in a whole target directory file link are obtained from a document object model of the target directory, hypertext markup language document content is obtained according to the text links, picture links in the whole target directory file link are obtained, picture content is obtained according to the picture links, the picture content is spliced to a corresponding position in the hypertext markup language document content to generate a file to be converted, and each page directory identifier in the document object model is spliced to generate a directory webpage structure, and the file to be converted is generated according to the file to be converted and the directory webpage structure;
converting the file to be converted according to a preset format to generate a target format file, and downloading the target format file to a preset downloading position;
and running a preset command line tool, and performing online conversion on the target format file in the preset downloading position to generate an online document.
2. The method of claim 1, further comprising, prior to running the preset plugin tool to obtain the file to be converted from the target directory:
acquiring a root directory node of the file to be converted;
and determining the target directory according to the root directory node.
3. The method of claim 1, wherein the running a preset command line tool comprises:
determining a preset storage position;
and running the preset command line tool in a storage catalog corresponding to the preset storage position.
4. The method of claim 1, wherein obtaining text links in the entire target directory file link from a document object model of the target directory comprises:
traversing a document object model of the target directory;
expanding all nodes under the target directory node to obtain the whole target directory file link;
and acquiring the text link from the whole target directory file link.
5. The method of claim 1, further comprising, after obtaining the picture content from the picture link:
converting the picture content according to a preset picture format to generate a picture with a target format;
splicing the picture content to a corresponding position in the hypertext markup language document content to generate the document to be converted, including:
and splicing the target format picture to a corresponding position in the content of the hypertext markup language document to generate the document to be converted.
6. The method of claim 1, wherein the running a preset command line tool to online convert the target format file in the preset download location to generate an online document comprises:
running the preset command line tool starting command, acquiring a target position, copying a configuration file stored in the preset command line tool into the target position, and simultaneously transmitting a path of the preset downloading position downwards;
copying the target format file to the target position according to the path of the preset downloading position;
and executing a online conversion tool to convert the target format file into the online document.
7. An online data generation apparatus, comprising:
the first acquisition module is used for operating a preset plug-in tool to acquire a file to be converted from a target directory, wherein text links in a whole target directory file link are acquired from a document object model of the target directory, hypertext markup language document content is acquired according to the text links, picture links in the whole target directory file link are acquired, picture content is acquired according to the picture links, the picture content is spliced to a corresponding position in the hypertext markup language document content to generate a file to be converted, and each page directory identifier in the document object model is spliced to generate a directory webpage structure, and the file to be converted is generated according to the file to be converted and the directory webpage structure;
the conversion downloading module is used for converting the file to be converted according to a preset format to generate a target format file and downloading the target format file to a preset downloading position;
the operation module is used for operating a preset command line tool;
and the processing module is used for carrying out online conversion on the target format file in the preset downloading position to generate an online document.
8. The apparatus as recited in claim 7, further comprising:
the second acquisition module is used for acquiring the root directory node of the file to be converted;
and the determining module is used for determining the target directory according to the root directory node.
9. The apparatus of claim 7, wherein the operation module is specifically configured to:
determining a preset storage position;
and running the preset command line tool in a storage catalog corresponding to the preset storage position.
10. The apparatus of claim 7, wherein obtaining text links in the entire target directory file link from a document object model of the target directory comprises:
traversing a document object model of the target directory;
expanding all nodes under the target directory node to obtain the whole target directory file link;
and acquiring the text link from the whole target directory file link.
11. The apparatus of claim 7, further comprising, after obtaining the picture content from the picture link:
converting the picture content according to a preset picture format to generate a picture with a target format;
splicing the picture content to a corresponding position in the hypertext markup language document content to generate the document to be converted, including:
and splicing the target format picture to a corresponding position in the content of the hypertext markup language document to generate the document to be converted.
12. The apparatus of claim 7, wherein the processing module is specifically configured to:
acquiring a target position, copying a configuration file stored in the preset command line tool into the target position, and simultaneously transmitting a path of the preset downloading position downwards;
copying the target format file to the target position according to the path of the preset downloading position;
and executing a online conversion tool to convert the target format file into the online document.
13. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the online data generation method according to any of claims 1-6 when executing the computer program.
14. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the online data generation method according to any of claims 1-6.
CN201911118340.3A 2019-11-15 2019-11-15 Online data generation method and device, electronic equipment and storage medium Active CN111159099B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911118340.3A CN111159099B (en) 2019-11-15 2019-11-15 Online data generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911118340.3A CN111159099B (en) 2019-11-15 2019-11-15 Online data generation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111159099A CN111159099A (en) 2020-05-15
CN111159099B true CN111159099B (en) 2023-08-22

Family

ID=70555986

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911118340.3A Active CN111159099B (en) 2019-11-15 2019-11-15 Online data generation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111159099B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111651196A (en) * 2020-06-24 2020-09-11 腾讯科技(深圳)有限公司 Document publishing method, device and server
CN112052224B (en) * 2020-08-17 2023-12-01 腾讯科技(上海)有限公司 File export method and device
CN112100126B (en) * 2020-11-03 2021-06-18 广州市玄武无线科技股份有限公司 Excel file-based picture storage and content display method and device
CN112527291A (en) * 2020-12-01 2021-03-19 瀚云科技有限公司 Webpage generation method and device, electronic equipment and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11353307A (en) * 1998-06-04 1999-12-24 Nec Corp Information converter
CN103955401A (en) * 2014-04-29 2014-07-30 南京新模式软件集成有限公司 Method for optimizing on-line preview of electronic document
JP2015087912A (en) * 2013-10-30 2015-05-07 キヤノン株式会社 Data transfer between document management systems
CN107480234A (en) * 2017-08-07 2017-12-15 四川长虹电器股份有限公司 A kind of enterprise-level documentation center implementation method based on git
CN108376127A (en) * 2018-03-15 2018-08-07 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer readable storage medium of document structure tree
CN108804503A (en) * 2018-04-12 2018-11-13 北京明朝万达科技股份有限公司 A kind of online method for previewing of document and system
CN109669684A (en) * 2018-12-29 2019-04-23 深圳点猫科技有限公司 For implementation method and device built in the technical documentation of Python editing machine
CN109710380A (en) * 2018-12-25 2019-05-03 杭州数梦工场科技有限公司 Manage the method and device of virtual resource in Cloud Server
CN110187916A (en) * 2019-05-31 2019-08-30 四川长虹电器股份有限公司 The method for generating Word document based on data configuration

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020116421A1 (en) * 2001-02-17 2002-08-22 Fox Harold L. Method and system for page-like display, formating and processing of computer generated information on networked computers
JP5398213B2 (en) * 2008-09-25 2014-01-29 インターナショナル・ビジネス・マシーンズ・コーポレーション Generating device, program, and generating method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11353307A (en) * 1998-06-04 1999-12-24 Nec Corp Information converter
JP2015087912A (en) * 2013-10-30 2015-05-07 キヤノン株式会社 Data transfer between document management systems
CN103955401A (en) * 2014-04-29 2014-07-30 南京新模式软件集成有限公司 Method for optimizing on-line preview of electronic document
CN107480234A (en) * 2017-08-07 2017-12-15 四川长虹电器股份有限公司 A kind of enterprise-level documentation center implementation method based on git
CN108376127A (en) * 2018-03-15 2018-08-07 武汉斗鱼网络科技有限公司 A kind of method, apparatus and computer readable storage medium of document structure tree
CN108804503A (en) * 2018-04-12 2018-11-13 北京明朝万达科技股份有限公司 A kind of online method for previewing of document and system
CN109710380A (en) * 2018-12-25 2019-05-03 杭州数梦工场科技有限公司 Manage the method and device of virtual resource in Cloud Server
CN109669684A (en) * 2018-12-29 2019-04-23 深圳点猫科技有限公司 For implementation method and device built in the technical documentation of Python editing machine
CN110187916A (en) * 2019-05-31 2019-08-30 四川长虹电器股份有限公司 The method for generating Word document based on data configuration

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
HTML逆向解析生成Markdown;siiakin;https://juejin.cn/psot/688449038588196447245;全文 *

Also Published As

Publication number Publication date
CN111159099A (en) 2020-05-15

Similar Documents

Publication Publication Date Title
CN111159099B (en) Online data generation method and device, electronic equipment and storage medium
JP5362588B2 (en) Application-based copy and paste operations
US8032881B2 (en) Method and system for upgrading a plurality of devices
US8185872B2 (en) Cross-platform software package generation
US20150067671A1 (en) Information processing apparatus, control method, and storage medium
US20100223541A1 (en) Automated and user customizable content retrieval from a collection of linked documents to a single target document
CN105049486A (en) Version management and file pulling control methods for static files, version management and file pulling control devices, and version control system
CN110795088B (en) Front-end engineering project construction method and tool, and computer-readable storage medium
KR20060069248A (en) Systems and methods for converting a formatted document to a web page
CN108563440B (en) Automatic adding method and device of list controller codes and readable storage medium
CN114706658A (en) Container mirror image data processing method, device, equipment and medium
CN111045717B (en) Method, device, computer equipment and storage medium for acquiring project dependent package
CN113467790B (en) Software packaging method and device and readable storage medium
CN112632425B (en) Method, device, equipment and storage medium for generating offline resource file
US8407583B2 (en) Information processing apparatus, information processing method, computer-readable medium and computer data signal
US8245182B2 (en) Class selectable design sharing
JPWO2014102935A1 (en) Electronic manual browsing device and system
CN112667224A (en) File processing method and device, computer equipment and storage medium
JP2000181718A (en) Method and system for firmware upgrade
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
US10275127B2 (en) Client apparatus, information processing system, information processing method, and non-transitory computer readable medium
US20210232562A1 (en) Container-image reproduction and debugging
US9940334B2 (en) Image forming apparatus and control method thereof
JP2020035184A (en) Application program and data transfer system
JP5526991B2 (en) Information processing apparatus, information processing method, program, information processing system

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
GR01 Patent grant
GR01 Patent grant