File processing method and device, computer equipment and storage medium

By automatically processing the content extraction of Markdown files, the problem of inefficient manual operation in financial enterprises in project databases is solved, and efficient and accurate file data extraction and sending is achieved.

CN119127803APending Publication Date: 2024-12-13CHINA PING AN PROPERTY INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411173806.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-23
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the prior art, financial enterprises manually operate the content extraction process of Markdown files in project databases is inefficient, prone to errors, and takes a long time.

Method used

By obtaining project database files based on the development platform, traversing and extracting Markdown files, using the parsing library to extract title and content data, performing security detection and generating sending requests, calling the processing interface to send data to the target server, realizing automated processing.

Benefits of technology

It improves the efficiency of Markdown file content extraction, reduces workload, avoids errors in human operations, and ensures data accuracy and intelligent processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119127803A_ABST
    Figure CN119127803A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of big data and the field of financial science and technology, and relates to a file processing method which comprises the steps of obtaining all files in a project database based on a development platform; traversing all the files, and obtaining a Mar kdown file from all the files based on a circulation mode; extracting a specified head tag from the Mar kdown file to obtain title data; extracting content data from the Mar kdown file based on the analysis library; if the content data passes the security detection, generating a sending request corresponding to the Mar kdown file based on the title data and the content data; and calling the processing interface to send the sending request to the target server. The invention further provides a file processing device, computer equipment and a storage medium. In addition, the sending request can be stored in the block chain. The method can be applied to a file processing scene in the financial field, the processing efficiency of content extraction is improved through the processing mode of automatically extracting the content of the Mar kdown file, and the accuracy of the obtained title data and content data is guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of big data technology and financial technology, and in particular to file processing methods, devices, computer equipment and storage media. Background Art

[0002] In the front-end development of the financial field, many financial enterprises will develop corresponding project databases. The project database can be a project library corresponding to financial data, which can include transaction data, payment data, business data, etc. There are usually some document files in the project database, and most of these document files are Markdown files, and the Markdown files are distributed in different directories.

[0003] At present, there are some tools for processing Markdown files in the industry, but these existing tools usually only provide some basic Markdown file operation functions, such as reading files, parsing Markdown syntax, etc. In the actual business processing flow, when it is necessary to extract the content of the Markdown files contained in the project database, the existing processing method is usually for the staff to complete the content extraction of the Markdown files contained in the project database manually. This processing method takes a lot of processing time, has a large workload, low processing efficiency, and is prone to errors in manual operations. Summary of the invention

[0004] The purpose of the embodiments of the present application is to propose a file processing method, apparatus, computer equipment and storage medium to solve the technical problem that when it is necessary to extract the content of Markdown files contained in a project database, the existing processing method is usually for staff to manually operate to complete the content extraction of Markdown files contained in the project database. This processing method requires a lot of processing time, a large workload, low processing efficiency, and the risk of errors in manual operation.

[0005] In order to solve the above technical problems, the present application provides a file processing method, which adopts the following technical solution:

[0006] Get all files in the project database based on the preset development platform;

[0007] Traverse all the files, and obtain Markdown files from all the files based on a preset loop method;

[0008] Extract data matching a specified header tag from the Markdown file to obtain header data corresponding to the Markdown file;

[0009] Extracting corresponding content data from the Markdown file based on a preset parsing library;

[0010] Performing security detection on the content data;

[0011] If the content data passes the security check, generating a sending request corresponding to the Markdown file based on the title data and the content data;

[0012] The preset processing interface is called to send the sending request to the target server.

[0013] Furthermore, the step of extracting corresponding content data from the Markdown file based on a preset parsing library specifically includes:

[0014] Calling the parsing library;

[0015] Parsing the Markdown file into structured data based on the parsing library, and obtaining paragraph data from the structured data;

[0016] Determining row information related to sorting from the paragraph data;

[0017] Removing the row information from the paragraph data to obtain corresponding target paragraph data;

[0018] The content data is generated based on the target paragraph data.

[0019] Furthermore, the step of calling a preset processing interface to send the sending request to the target server specifically includes:

[0020] Get the preset interface library;

[0021] Obtaining a request identifier corresponding to the sending request;

[0022] Acquire a designated interface corresponding to the request identifier from the interface library, and use the designated interface as the processing interface;

[0023] Obtaining address information of the target server;

[0024] Based on the address information, the sending request is sent to the target server using the processing interface.

[0025] Furthermore, the step of obtaining all files in the project database based on the preset development platform specifically includes:

[0026] Calling the file system module in the development platform;

[0027] Reading the directory in the project database through the file system module;

[0028] All files in the directory in the project database are obtained through the file system module.

[0029] Furthermore, after the step of traversing all the files and obtaining the Markdown file from all the files based on a preset loop method, the method further includes:

[0030] Filtering out image data that conforms to a preset image format from the Markdown file, and constructing an image file list based on the image data;

[0031] Constructing first picture object data corresponding to the picture file list based on a preset creation method;

[0032] Constructing second picture object data based on the first picture object data; wherein the second picture object data is data that has undergone picture reference path modification processing;

[0033] Creating an upload request corresponding to the second picture object data;

[0034] Based on a preset upload interface, the upload request is uploaded to the target server.

[0035] Furthermore, the step of constructing the first picture object data corresponding to the picture file list based on the preset creation method specifically includes:

[0036] Read the picture data in the picture file list based on a preset reading method, and create a binary stream for the picture data to obtain corresponding specified image data;

[0037] Storing the designated image data into preset initial data;

[0038] Construct an initial picture object based on the creation method;

[0039] Assigning the initial data to the initial picture object to obtain a processed initial picture object;

[0040] The first picture object data corresponding to the picture file list is generated based on the processed initial picture object.

[0041] Further, after the step of calling the preset processing interface to send the sending request to the target server, it also includes:

[0042] Receiving feedback information sent by the target server;

[0043] Performing data analysis on the feedback information to determine whether there is a specified Markdown file for which data sending fails;

[0044] If yes, obtain the specified data corresponding to the specified Markdown file;

[0045] Get the preset retry strategy;

[0046] Based on the retry strategy, the designated data is resent.

[0047] In order to solve the above technical problems, the embodiment of the present application further provides a file processing device, which adopts the following technical solution:

[0048] A first acquisition module is used to acquire all files in a project database based on a preset development platform;

[0049] A second acquisition module is used to traverse all the files and acquire Markdown files from all the files based on a preset loop method;

[0050] A first extraction module is used to extract data matching a specified header tag from the Markdown file to obtain title data corresponding to the Markdown file;

[0051] A second extraction module, used to extract corresponding content data from the Markdown file based on a preset parsing library;

[0052] A detection module, used for performing security detection on the content data;

[0053] A generating module, configured to generate a sending request corresponding to the Markdown file based on the title data and the content data if the content data passes the security detection;

[0054] The sending module is used to call a preset processing interface to send the sending request to the target server.

[0055] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0056] Get all files in the project database based on the preset development platform;

[0057] Traverse all the files, and obtain Markdown files from all the files based on a preset loop method;

[0058] Extract data matching a specified header tag from the Markdown file to obtain header data corresponding to the Markdown file;

[0059] Extracting corresponding content data from the Markdown file based on a preset parsing library;

[0060] Performing security detection on the content data;

[0061] If the content data passes the security check, generating a sending request corresponding to the Markdown file based on the title data and the content data;

[0062] The preset processing interface is called to send the sending request to the target server.

[0063] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0064] Get all files in the project database based on the preset development platform;

[0065] Traverse all the files, and obtain Markdown files from all the files based on a preset loop method;

[0066] Extract data matching a specified header tag from the Markdown file to obtain header data corresponding to the Markdown file;

[0067] Extracting corresponding content data from the Markdown file based on a preset parsing library;

[0068] Performing security detection on the content data;

[0069] If the content data passes the security check, generating a sending request corresponding to the Markdown file based on the title data and the content data;

[0070] The preset processing interface is called to send the sending request to the target server.

[0071] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0072] This application first obtains all files in the project database based on a preset development platform; then traverses all the files and obtains Markdown files from all the files based on a preset loop method; then extracts data matching the specified header tag from the Markdown file to obtain title data corresponding to the Markdown file; subsequently extracts corresponding content data from the Markdown file based on a preset parsing library; further performs security checks on the content data; if the content data passes the security check, generates a sending request corresponding to the Markdown file based on the title data and the content data; finally, calls a preset processing interface to send the sending request to the target server. This application first obtains the Markdown file in the project database based on the use of the development platform and the loop method, then extracts the data matching the specified header tag from the Markdown file to obtain the title data of the Markdown file, and extracts the content data of the Markdown file based on the use of the parsing library, so as to automatically, quickly and accurately complete the content extraction processing of the Markdown file contained in the project database. Compared with the existing manual operation method, the processing method of automatically extracting the content of the Markdown file proposed in this application effectively reduces the processing time of content extraction, reduces the workload of content extraction processing, improves the processing efficiency of content extraction, and can avoid errors that may occur during manual operation, ensuring the accuracy of the obtained title data and content data. In addition, after determining that the content data has passed the security detection, it will intelligently generate a sending request corresponding to the Markdown file based on the title data and the content data, and call the preset processing interface to send the sending request to the target server, so that there is no need to manually process the sending processing of the extracted content of the Markdown file, further improving the processing efficiency and processing intelligence of the sending processing of the extracted content of the Markdown file. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0074] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0075] Figure 2 A flowchart of an embodiment of a file processing method according to the present application;

[0076] Figure 3 is a schematic structural diagram of an embodiment of a file processing device according to the present application;

[0077] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0078] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0079] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0080] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0081] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0082] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0083] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0084] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0085] It should be noted that the file processing method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the file processing device is generally arranged in the server / terminal device.

[0086] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0087] Continue to refer Figure 2 , shows a flowchart of an embodiment of the file processing method according to the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The file processing method provided in the embodiment of the present application can be applied to any scenario where file processing is required, and the file processing method can be applied to products in these scenarios, for example, file processing for project databases in the financial insurance field. The file processing method comprises the following steps:

[0088] Step S201, obtaining all files in the project database based on a preset development platform.

[0089] In this embodiment, the electronic device (eg, Figure 1The server / terminal device shown in the figure) can obtain all files in the project database through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods that are currently known or will be developed in the future. In the financial field, many financial businesses will develop corresponding project databases. There are usually some document files in the project database, and most of these document files are Markdown files, and the Markdown files are distributed in different directories. Such documents are not executable. The project database can be a project library corresponding to financial data, and the financial data may include transaction data, payment data, business data, and so on. Of course, in addition to Markdown files, the document files in the project database can also be files of other formats. Among them, the above-mentioned development platform is specifically a Node.js development platform. Node.js, referred to as Node, is a development platform that can enable JavaScript to run on the server side. JavaScript is a Web front-end language, and Node.js makes JavaScript a server-side scripting language. In addition, the specific implementation process of obtaining all files in the project database based on the preset development platform will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated here.

[0090] Step S202, traverse all the files, and obtain Markdown files from all the files based on a preset loop method.

[0091] In this embodiment, the above loop method can specifically adopt a for loop. By traversing all files in the project database, and using a for loop to obtain files that conform to the .md format in all files, the corresponding Markdown files can be obtained. By using the traversal loop method, the Markdown files can be extracted from all the files quickly and efficiently. In addition, after all files are traversed, the loop will be exited.

[0092] Step S203: extract data matching the specified header tag from the Markdown file to obtain title data corresponding to the Markdown file.

[0093] In this embodiment, the above-mentioned specified header tag specifically refers to the title tag of the header. Data matching the title tag of the header can be extracted from the Markdown file and used as the title data of the Markdown file, thereby accurately realizing the automatic extraction and processing of the title data of the Markdown file.

[0094] Step S204: extract corresponding content data from the Markdown file based on a preset parsing library.

[0095] In this embodiment, the specific implementation process of extracting the corresponding content data from the Markdown file based on the preset parsing library will be described in further detail in subsequent specific embodiments of the present application, and will not be elaborated on here.

[0096] Step S205: Perform security check on the content data.

[0097] In this embodiment, the antivirus software built into the electronic device can be called and used to scan the content data to perform security detection and generate corresponding detection results, wherein the detection results may include passing the security detection or failing the security detection.

[0098] Step S206: If the content data passes the security check, a sending request corresponding to the Markdown file is generated based on the title data and the content data.

[0099] In this embodiment, if the detection result obtained is that the security detection has been passed, that is, the content data has passed the security detection, then a sending request for sending the title data and the content data to the target server will be constructed subsequently.

[0100] Step S207: calling a preset processing interface to send the sending request to a target server.

[0101] In this embodiment, the specific implementation process of calling the preset processing interface to send the sending request to the target server will be further described in detail in subsequent specific embodiments of the present application, and will not be elaborated on here.

[0102] This application first obtains all files in the project database based on a preset development platform; then traverses all the files and obtains Markdown files from all the files based on a preset loop method; then extracts data matching the specified header tag from the Markdown file to obtain title data corresponding to the Markdown file; subsequently extracts corresponding content data from the Markdown file based on a preset parsing library; further performs security checks on the content data; if the content data passes the security check, generates a sending request corresponding to the Markdown file based on the title data and the content data; finally, calls a preset processing interface to send the sending request to the target server. This application first obtains the Markdown file in the project database based on the use of the development platform and the loop method, then extracts the data matching the specified header tag from the Markdown file to obtain the title data of the Markdown file, and extracts the content data of the Markdown file based on the use of the parsing library, so as to automatically, quickly and accurately complete the content extraction processing of the Markdown file contained in the project database. Compared with the existing manual operation method, the processing method of automatically extracting the content of the Markdown file proposed in this application effectively reduces the processing time of content extraction, reduces the workload of content extraction processing, improves the processing efficiency of content extraction, and can avoid errors that may occur during manual operation, ensuring the accuracy of the obtained title data and content data. In addition, after determining that the content data has passed the security detection, it will intelligently generate a sending request corresponding to the Markdown file based on the title data and the content data, and call the preset processing interface to send the sending request to the target server, so that there is no need to manually process the sending processing of the extracted content of the Markdown file, further improving the processing efficiency and processing intelligence of the sending processing of the extracted content of the Markdown file.

[0103] In some optional implementations, step S204 includes the following steps:

[0104] The parsing library is called.

[0105] In this embodiment, the above-mentioned parsing library can specifically adopt the markdown-it library or the markdown-js library.

[0106] The Markdown file is parsed into structured data based on the parsing library, and paragraph data is obtained from the structured data.

[0107] In this embodiment, the Markdown file is parsed using the parsing library to obtain corresponding structured data, which at least includes data such as paragraphs, lists, and titles. After obtaining the above structured data, paragraph data can be further extracted from the structured data.

[0108] Row information related to sorting is determined from the paragraph data.

[0109] In this embodiment, the above-mentioned line information related to sorting refers to the line number or special mark in the paragraph data. Such information does not belong to the Markdown file and only serves as a sorting mark.

[0110] The row information is removed from the paragraph data to obtain corresponding target paragraph data.

[0111] In this embodiment, the position information of the line information in the paragraph data may be obtained, and then the line information may be removed from the paragraph data according to the position information, thereby obtaining the corresponding target paragraph data.

[0112] The content data is generated based on the target paragraph data.

[0113] In this embodiment, the target paragraph data can be directly generated as the content data of the Markdown file. Alternatively, all target paragraph data can be integrated to obtain integrated data, and the integrated data can be used as the content data.

[0114] The present application calls the parsing library; then parses the Markdown file into structured data based on the parsing library, and obtains paragraph data from the structured data; then determines the row information related to sorting from the paragraph data, and removes the row information from the paragraph data to obtain the corresponding target paragraph data; and subsequently generates the content data based on the target paragraph data. The present application uses the parsing library to parse the Markdown file, obtains paragraph data from the structured data obtained by parsing, and further removes the row information related to sorting from the paragraph data to obtain the final content data, thereby effectively achieving the precise extraction of the content data of the Markdown file and ensuring the accuracy of the obtained content data.

[0115] In some optional implementations of this embodiment, step S207 includes the following steps:

[0116] Get the preset interface library.

[0117] In this embodiment, for different request processing types, one-to-one corresponding interfaces adapted to various request processing types will be constructed in advance, and after the interface construction is completed, all interfaces will be stored in a database to generate a corresponding interface library. Among them, the above request processing types can be set according to actual processing requirements, for example, including sending request types, uploading request types, query request types, access request types, etc. Correspondingly, the interfaces in the interface library may at least include sending interfaces, uploading interfaces, query interfaces, and access interfaces.

[0118] Obtain a request identifier corresponding to the sending request.

[0119] In this embodiment, the request identifier may refer to a request processing type of the sending request, specifically a sending request type.

[0120] A designated interface corresponding to the request identifier is obtained from the interface library, and the designated interface is used as the processing interface.

[0121] In this embodiment, the interface library can be queried using the above-mentioned request identifier, and the specified request processing type that matches the request representation can be queried from the interface library first, and then the specified interface that matches the specified request processing type can be extracted from the interface library to obtain the above-mentioned processing interface.

[0122] Obtain the address information of the target server.

[0123] In this embodiment, the above-mentioned address information specifically refers to the communication address information of the target server.

[0124] Based on the address information, the sending request is sent to the target server using the processing interface.

[0125] In this embodiment, after the address information of the target server is obtained, communication and interaction with the target server can be performed according to the address information, and the sending request can be sent to the target server using the processing interface.

[0126] The present application obtains a preset interface library; then obtains a request identifier corresponding to the sending request; then obtains a designated interface corresponding to the request identifier from the interface library, and uses the designated interface as the processing interface; subsequently obtains the address information of the target server; and finally, based on the address information, uses the processing interface to send the sending request to the target server. The present application uses an interface library to filter out a designated interface that matches the request identifier corresponding to the sending request and uses it as a processing interface, and then subsequently uses the processing interface to send the sending request to the target server according to the address information of the target server, thereby realizing intelligent and rapid completion of standardized sending processing of the sending request based on a dedicated processing interface adapted to the processing request, ensuring normal processing of the sending request, and improving the processing standardization and efficiency of the sending request.

[0127] In some optional implementations, step S201 includes the following steps:

[0128] The file system module in the development platform is called.

[0129] In this embodiment, the above development platform is specifically the Node.js development platform. The Node.js runtime environment contains all the conditions required to execute JavaScript programs. The engine converts JavaScript code into faster machine code. Node.js further enhances the capabilities of JavaScript, allowing JavaScript to access files, read databases, and access processes, thereby being competent for backend tasks. Among them, the above file system module specifically refers to the fs file system module in the Node.js development platform.

[0130] The directories in the project database are read by the file system module.

[0131] In this embodiment, the recursive reading of directories and subdirectories in the project database is achieved by using the file system module.

[0132] All files in the directory in the project database are obtained through the file system module.

[0133] In this embodiment, the file system module specifically uses fs.readdir and fs.stat functions to recursively read the directory in the project database and obtain information of all files.

[0134] The present application calls the file system module in the development platform; then reads the directory in the project database through the file system module; and subsequently obtains all files in the directory in the project database through the file system module. The present application can quickly and accurately obtain all files in the directory in the project database by using the file system module in the development platform, effectively improving the efficiency of obtaining files in the project database.

[0135] In some optional implementations, after step S202, the electronic device may further perform the following steps:

[0136] Image data that conforms to a preset image format is filtered out from the Markdown file, and an image file list is constructed based on the image data.

[0137] In this embodiment, the above-mentioned picture format is specifically a png picture format. After obtaining the picture data, all the picture data can be integrated and stored in a list to construct a corresponding picture file list.

[0138] Construct first picture object data corresponding to the picture file list based on a preset creation method.

[0139] In this embodiment, the above creation method can specifically adopt the new FormData() method. The specific implementation process of constructing the first picture object data corresponding to the picture file list based on the preset creation method will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated here.

[0140] Constructing second picture object data based on the first picture object data; wherein the second picture object data is data that has undergone picture reference path modification processing.

[0141] In this embodiment, the second image object data is specifically an options object, and the properties of the options object include request method post, hostname, path, headers and first image data. The image reference path modification process refers to retaining the specified part of the original image relative path in the path path and putting it into the path, so that the subsequent Markdown file can be displayed normally after replacing the image link. The specified part specifically refers to the second half.

[0142] Create an upload request corresponding to the second image object data.

[0143] In this embodiment, the upload request is a request constructed to upload the second picture object data to a target server.

[0144] Based on a preset upload interface, the upload request is uploaded to the target server.

[0145] In this embodiment, by obtaining the specified request identifier corresponding to the above-mentioned upload request, the target interface corresponding to the specified request identifier can be obtained from the interface library and used as the above-mentioned upload interface. Subsequently, according to the address information of the target server, the upload interface is used to upload the upload request to the target server.

[0146] This application filters out the image data that conforms to the preset image format from the Markdown file, and constructs an image file list based on the image data; then constructs the first image object data corresponding to the image file list based on the preset creation method; then constructs the second image object data based on the first image object data; subsequently creates an upload request corresponding to the second image object data; and finally uploads the upload request to the target server based on the preset upload interface. After obtaining the Markdown file from all the files based on the traversal loop, this application will automatically and intelligently filter out the image data that conforms to the image format from the Markdown file and construct an image file list, and then create the second image object data corresponding to the image file list based on the creation method and the image reference path modification processing method, and then use the upload interface to upload the constructed upload request corresponding to the second image object data to the target server. Through the above-mentioned processing method for the image data in the Markdown file, this application realizes the function of modifying the image reference path and automatically uploading the Markdown file, thereby effectively ensuring that the Markdown file is displayed normally on the target server after migration, and improving the quality and availability of the processed Markdown file.

[0147] In some optional implementations of this embodiment, the step of constructing the first picture object data corresponding to the picture file list based on a preset creation method includes the following steps:

[0148] The picture data in the picture file list is read based on a preset reading method, and a binary stream is created for the picture data to obtain corresponding designated image data.

[0149] In this embodiment, the above reading method can specifically adopt the nodejs fs.createReadStream() method. By using this reading method, the image data in the image file list can be read, and the image data can be further created into a binary stream, thereby obtaining the corresponding specified image data.

[0150] The designated image data is stored in the preset initial data.

[0151] In this embodiment, the initial data may be pre-constructed data data.

[0152] Construct an initial picture object based on the creation method.

[0153] In this embodiment, the creation method specifically adopts the new FormData() method. By using the newFormData() method, a form object, namely the initial picture object, can be created.

[0154] The initial data is assigned to the initial picture object to obtain a processed initial picture object.

[0155] In this embodiment, the initial data can be assigned to the initial picture object, that is, the read picture data stored in data is stored in the above-mentioned form object, so as to obtain the corresponding processed initial picture object.

[0156] The first picture object data corresponding to the picture file list is generated based on the processed initial picture object.

[0157] In this embodiment, after obtaining the processed initial picture object, headers data may be further created for the processed initial picture object and stored in related cookies, thereby obtaining a form expression object and serving as the above-mentioned first picture object data.

[0158] The present application reads the image data in the image file list based on a preset reading method, and creates a binary stream for the image data to obtain the corresponding specified image data; then stores the specified image data in the preset initial data; then constructs an initial image object based on the creation method; subsequently assigns the initial data to the initial image object to obtain a processed initial image object; and finally generates the first image object data corresponding to the image file list based on the processed initial image object. The present application processes the image file list through a preset reading method to create specified image data, and stores the specified image data in the preset initial data, and then assigns the initial data to the initial image object constructed based on the preset creation method to obtain a processed initial image object, so that the first image object data corresponding to the image file list can be automatically and accurately generated based on the processed initial image object, thereby ensuring the accuracy of the obtained first image object data.

[0159] In some optional implementations of this embodiment, after step S207, the electronic device may further perform the following steps:

[0160] Receive feedback information sent by the target server.

[0161] In this embodiment, after completing the sending process of sending the sending request to the target server using the processing interface, the target server will also return feedback information about the data reception corresponding to the sending request. Among them, the feedback information may include normal data reception or abnormal data reception. And if there is an abnormal data reception, the file information of the Markdown file corresponding to the abnormal data reception will also be recorded in the feedback information. The file information may include the file name.

[0162] Data analysis is performed on the feedback information to determine whether there is a specified Markdown file for which data sending fails.

[0163] In this embodiment, by performing data analysis on the feedback information, if the content of the feedback information is that the data reception is normal, it is determined that there is no designated Markdown file whose data transmission fails during the transmission process of sending the transmission request to the target server. If the content of the feedback information is that the data reception is abnormal, it is determined that there is a designated Markdown file whose data transmission fails during the transmission process of sending the transmission request to the target server, and the designated file name of the designated Markdown file is further extracted from the feedback information summary.

[0164] If so, obtain the specified data corresponding to the specified Markdown file.

[0165] In this embodiment, the specified data corresponding to the specified Markdown file can be queried according to the specified file name of the specified Markdown file, wherein the specified data includes the title data and content data of the specified Markdown file.

[0166] Get the preset retry strategy.

[0167] In this embodiment, the selection of the above retry strategy is not specifically limited. For example, the retry strategy can be based on a preset number of retries. Alternatively, the above retry strategy can also specifically adopt a retry strategy based on an exponential backoff algorithm. By using the exponential backoff algorithm for retry processing, the frequency of continuous retries can be reduced when data transmission fails, thereby reducing the pressure on the server.

[0168] Based on the retry strategy, the designated data is resent.

[0169] In this embodiment, the designated data can be resent multiple times corresponding to the number of retries within the retry strategy, so that the data can be automatically resent when the data fails to be sent, which is beneficial to ensure the normal sending of data and increase the success rate of normal data sending.

[0170] This application receives feedback information sent by the target server; then performs data analysis on the feedback information to determine whether there is a specified Markdown file whose data transmission fails; if so, obtains the specified data corresponding to the specified Markdown file; then obtains a preset retry strategy; and subsequently resends the specified data based on the retry strategy. After receiving the feedback information sent by the target server, if the application detects that there is a specified Markdown file whose data transmission fails, it will automatically and intelligently obtain the specified data corresponding to the specified Markdown file, and use the retry strategy to resend the specified data, so as to automatically execute the resending of data when the data transmission fails, thereby facilitating the normal transmission of the data that failed to be transmitted, and increasing the success probability of the normal transmission of the data that failed to be transmitted.

[0171] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0172] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned sending request, the above-mentioned sending request can also be stored in a node of a blockchain.

[0173] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0174] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0175] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0176] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0177] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0178] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a file processing device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0179] like Figure 3 As shown, the file processing device 300 described in this embodiment includes: a first acquisition module 301, a second acquisition module 302, a first extraction module 303, a second extraction module 304, a detection module 305, a generation module 306 and a sending module 307. Among them:

[0180] The first acquisition module 301 is used to acquire all files in the project database based on a preset development platform;

[0181] A second acquisition module 302 is used to traverse all the files and acquire Markdown files from all the files based on a preset loop method;

[0182] A first extraction module 303 is used to extract data matching a specified header tag from the Markdown file to obtain title data corresponding to the Markdown file;

[0183] A second extraction module 304 is used to extract corresponding content data from the Markdown file based on a preset parsing library;

[0184] A detection module 305, used for performing security detection on the content data;

[0185] A generating module 306, configured to generate a sending request corresponding to the Markdown file based on the title data and the content data if the content data passes the security check;

[0186] The sending module 307 is used to call a preset processing interface to send the sending request to the target server.

[0187] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and are not described in detail here.

[0188] In some optional implementations of this embodiment, the second extraction module 304 includes:

[0189] A first calling submodule, used for calling the parsing library;

[0190] A parsing submodule, used for parsing the Markdown file into structured data based on the parsing library, and obtaining paragraph data from the structured data;

[0191] A determination submodule, used to determine row information related to sorting from the paragraph data;

[0192] A removal submodule, used to remove the line information from the paragraph data to obtain corresponding target paragraph data;

[0193] The first generating submodule is used to generate the content data based on the target paragraph data.

[0194] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and are not described in detail here.

[0195] In some optional implementations of this embodiment, the sending module 307 includes:

[0196] The first acquisition submodule is used to acquire a preset interface library;

[0197] A second acquisition submodule is used to acquire a request identifier corresponding to the sending request;

[0198] A third sub-acquisition module is used to acquire a designated interface corresponding to the request identifier from the interface library, and use the designated interface as the processing interface;

[0199] The fourth acquisition submodule is used to obtain the address information of the target server;

[0200] A sending submodule is used to send the sending request to the target server using the processing interface based on the address information.

[0201] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and will not be repeated here.

[0202] In some optional implementations of this embodiment, the first acquisition module 301 includes:

[0203] A second calling submodule is used to call the file system module in the development platform;

[0204] A first reading submodule, used for reading the directory in the project database through the file system module;

[0205] The fifth acquisition submodule is used to acquire all files in the directory in the project database through the file system module.

[0206] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and are not described in detail here.

[0207] In some optional implementations of this embodiment, the file processing device further includes:

[0208] A screening module, used to screen out image data that conforms to a preset image format from the Markdown file, and construct an image file list based on the image data;

[0209] A first construction module, used to construct first picture object data corresponding to the picture file list based on a preset creation method;

[0210] A second construction module is used to construct second picture object data based on the first picture object data; wherein the second picture object data is data that has undergone picture reference path modification processing;

[0211] A creation module, used for creating an upload request corresponding to the second picture object data;

[0212] The upload module is used to upload the upload request to the target server based on a preset upload interface.

[0213] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and are not described in detail here.

[0214] In some optional implementations of this embodiment, the first building block includes:

[0215] A second reading submodule is used to read the picture data in the picture file list based on a preset reading method, and create a binary stream for the picture data to obtain corresponding specified image data;

[0216] A storage submodule, used for storing the specified image data into preset initial data;

[0217] A construction submodule, used to construct an initial picture object based on the creation method;

[0218] An assignment submodule, used for assigning the initial data to the initial picture object to obtain a processed initial picture object;

[0219] The second generating submodule is used to generate the first picture object data corresponding to the picture file list based on the processed initial picture object.

[0220] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and are not described in detail here.

[0221] In some optional implementations of this embodiment, the file processing device further includes:

[0222] A receiving module, used for receiving feedback information sent by the target server;

[0223] A judgment module is used to perform data analysis on the feedback information to determine whether there is a specified Markdown file for which data sending fails;

[0224] A second acquisition module, configured to, if yes, acquire specified data corresponding to the specified Markdown file;

[0225] The third acquisition module is used to obtain a preset retry strategy;

[0226] A processing module is used to resend the designated data based on the retry strategy.

[0227] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the file processing method in the aforementioned implementation mode, and are not described in detail here.

[0228] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0229] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0230] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0231] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the file processing method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0232] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the file processing method.

[0233] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0234] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the file processing method as described above.

[0235] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0236] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A file processing method, characterized in that: The steps include: Get all files in the project database based on the preset development platform; Traversing all the files, and obtaining Markdown files from all the files based on a preset loop method; Extract data matching the specified header tag from the Markdown file to obtain title data corresponding to the Markdown file; Extracting corresponding content data from the Markdown file based on a preset parsing library; Performing security detection on the content data; If the content data passes the security check, generating a sending request corresponding to the Markdown file based on the title data and the content data; The preset processing interface is called to send the sending request to the target server.

2. The file processing method according to claim 1, characterized in that: The step of extracting corresponding content data from the Markdown file based on a preset parsing library specifically includes: Calling the parsing library; Parsing the Markdown file into structured data based on the parsing library, and acquiring paragraph data from the structured data; Determining row information related to sorting from the paragraph data; Removing the row information from the paragraph data to obtain corresponding target paragraph data; The content data is generated based on the target paragraph data.

3. The file processing method according to claim 1, characterized in that: The step of calling a preset processing interface to send the sending request to the target server specifically includes: Get the preset interface library; Obtaining a request identifier corresponding to the sending request; Acquire a designated interface corresponding to the request identifier from the interface library, and use the designated interface as the processing interface; Obtaining address information of the target server; Based on the address information, the sending request is sent to the target server using the processing interface.

4. The file processing method according to claim 1, characterized in that: The step of obtaining all files in the project database based on the preset development platform specifically includes: Calling the file system module in the development platform; Reading the directory in the project database through the file system module; All files in the directory in the project database are obtained through the file system module.

5. The file processing method according to claim 1, characterized in that: After the step of traversing all the files and obtaining Markdown files from all the files based on a preset loop method, the method further includes: Filtering out picture data conforming to a preset picture format from the Markdown file, and constructing a picture file list based on the picture data; Constructing first picture object data corresponding to the picture file list based on a preset creation method; Constructing second picture object data based on the first picture object data; wherein the second picture object data is data that has undergone picture reference path modification processing; Creating an upload request corresponding to the second picture object data; Based on a preset upload interface, the upload request is uploaded to the target server.

6. The file processing method according to claim 5, characterized in that: The step of constructing the first picture object data corresponding to the picture file list based on the preset creation method specifically includes: Read the picture data in the picture file list based on a preset reading method, and create a binary stream for the picture data to obtain corresponding specified image data; Storing the designated image data into preset initial data; Construct an initial picture object based on the creation method; Assigning the initial data to the initial picture object to obtain a processed initial picture object; The first picture object data corresponding to the picture file list is generated based on the processed initial picture object.

7. The file processing method according to claim 1, characterized in that: After the step of calling the preset processing interface to send the sending request to the target server, the method further includes: Receiving feedback information sent by the target server; Performing data analysis on the feedback information to determine whether there is a designated Markdown file for which data transmission fails; If yes, obtain the specified data corresponding to the specified Markdown file; Get the preset retry strategy; Based on the retry strategy, the designated data is resent.

8. A file processing device, characterized in that: include: A first acquisition module is used to acquire all files in a project database based on a preset development platform; A second acquisition module is used to traverse all the files and acquire a Markdown file from all the files based on a preset loop method; A first extraction module, used for extracting data matching a specified header tag from the Markdown file to obtain title data corresponding to the Markdown file; A second extraction module, used to extract corresponding content data from the Markdown file based on a preset parsing library; A detection module, used for performing security detection on the content data; A generating module, configured to generate a sending request corresponding to the Markdown file based on the title data and the content data if the content data passes the security detection; The sending module is used to call a preset processing interface to send the sending request to the target server.

9. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the file processing method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the file processing method according to any one of claims 1 to 7 are implemented.