CN115242777A - Method, system, server and storage medium for generating file - Google Patents

Method, system, server and storage medium for generating file Download PDF

Info

Publication number
CN115242777A
CN115242777A CN202210813061.4A CN202210813061A CN115242777A CN 115242777 A CN115242777 A CN 115242777A CN 202210813061 A CN202210813061 A CN 202210813061A CN 115242777 A CN115242777 A CN 115242777A
Authority
CN
China
Prior art keywords
file
task
server
request
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210813061.4A
Other languages
Chinese (zh)
Inventor
郝跃文
施亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Canglang Health Management Co ltd
Hangzhou Clove Health Management Co ltd
Hangzhou Lianke Meixun Biomedical Technology Co ltd
Guanlan Networks Hangzhou Co ltd
Original Assignee
Hangzhou Canglang Health Management Co ltd
Hangzhou Clove Health Management Co ltd
Hangzhou Lianke Meixun Biomedical Technology Co ltd
Guanlan Networks Hangzhou 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 Canglang Health Management Co ltd, Hangzhou Clove Health Management Co ltd, Hangzhou Lianke Meixun Biomedical Technology Co ltd, Guanlan Networks Hangzhou Co ltd filed Critical Hangzhou Canglang Health Management Co ltd
Priority to CN202210813061.4A priority Critical patent/CN115242777A/en
Publication of CN115242777A publication Critical patent/CN115242777A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding

Abstract

The application provides a method, a system, a server and a storage medium for generating files, wherein the method comprises the following steps: the method comprises the steps that a local server receives a request task about file generation initiated by a user, and generates a task ID based on the request task, wherein the request task comprises an accessible address and file parameters of a file generated by the user specification; and adding the request task into a corresponding task queue based on the type of the request task, generating a file specified by the request task according to the request task in the task queue, and sending the file to a file server. According to the method and the system, the local server asynchronously generates the file with the specified format, so that the service end can submit the request task in time without blocking, and abstract the resource consumption operation of the generated file to the local server, thereby improving the processing performance of the end server.

Description

Method, system, server and storage medium for generating file
Technical Field
The present application relates to the field of file format conversion technologies, and in particular, to a method, a system, a server, and a storage medium for generating a file.
Background
With the development of the internet, various business fields are beginning to rely on the internet technology. In diversified business scenes, it is often necessary to convert content in a specified format into a fixed format, for example, convert a web page into an electronic report PDF or an electronic prescription Image format, and so on. The content of these files is often dynamically generated based on the user's business data, and its content and format have their own features. Under a service scenario with a large number of users, various problems of the distributed cluster often need to be considered.
Taking generation of a PDF report as an example, in a conventional technical scheme, a developer needs to introduce a component for generating a PDF report in a project, then write a generation code of PDF file content, then store a PDF file in a local file system based on IO operation, and finally store a file access path in a service library and associate the file access path with a service entity. That is, the work of writing PDF content often needs a server developer, and the server developer is often not good at controlling the style of the content, and if a service scene has a higher requirement on the format of PDF, the cost and difficulty of writing and generating PDF will be greatly increased. In addition, the time consumption from the beginning of submitting the task to the end of the task is long, and the CPU and IO resources of the server are consumed highly.
At present, when a task of processing file format conversion is performed, a file requiring format conversion is mainly acquired, whether the file format is a document format is judged, then the document format file is initialized, the number of file pages included in each conversion subtask is configured according to preset parameters, the document format file is divided into a plurality of conversion subtasks, and finally the plurality of conversion subtasks are respectively sent to a plurality of document conversion nodes which are not currently processed by the conversion subtasks and are subjected to format conversion. On one hand, the system can only receive node tasks at the same time, and the transaction request is easy to block; on the other hand, each node in the system forwards the message, so that the same node can receive the same message for multiple times, and the redundancy is large.
Disclosure of Invention
The local server generates the file with the designated format asynchronously, so that the service end can submit the request task in time without blocking, the operation of generating the file which consumes the most resource is abstracted to the local server, the task distribution is clear, and the processing performance of the service end server is improved.
In a first aspect, this embodiment provides a method for generating a file, where the method includes:
the method comprises the steps that a local server receives a request task for generating a file initiated by a user, wherein the request task comprises an accessible address and file parameters of the file generated by the user specification;
and adding the request task into a corresponding task queue based on the type of the request task, generating a task ID based on the request task, generating a file specified by the request task according to the request task in the task queue, and sending the file to a file server.
In some embodiments, said sending the file to the file server includes:
the file server obtains a file ID and a file storage path based on the file;
judging whether the file needs to be kept secret, if so, sending the file ID to the local server by the file server, obtaining association information between the file ID and the task ID by the local server based on the file ID and the task ID, sending the association information and the file ID to a service application end, and obtaining the file storage path at the file server by the service application end based on the association information by using the file ID;
otherwise, the file server sends the file ID and the file storage path to the local server, the local server obtains the association information between the file ID and the task ID based on the file ID and sends the association information, the file ID and the file storage path to a service application end, and the service application end obtains the file storage path at the service application end based on the association information by using the file ID.
In some embodiments, the generating a file specified by the request task according to the request task in the task queue includes:
judging whether the request tasks to be processed exist in the task queue, if so, automatically triggering a consumption mechanism of the task queue to obtain the request tasks needing to be processed;
rendering the request task needing to be processed based on the webpage accessible address corresponding to the request task needing to be processed to obtain a visual image;
and acquiring the file specified by the request task according to the visual image and the file parameter.
In some embodiments, the rendering the requested task to be processed based on the accessible address corresponding to the requested task to be processed includes:
and monitoring whether the request tasks needing to be processed are abnormal in the life cycle, if so, acquiring the server nodes where the abnormal request tasks are positioned, and distributing all the incomplete request tasks in the server nodes to other server nodes.
In some embodiments, the generating a task ID based on the requested task further includes obtaining a progress of the requested task based on the task ID.
In some embodiments, the sending the file to the file server includes:
and the local server stores the file and sends the file to the file server, and the local server deletes the file after the file server successfully receives the file.
In a second aspect, this embodiment provides a system for generating a file, where the system includes: a service application terminal; wherein the content of the first and second substances,
the service application terminal is used for receiving a request task about file generation initiated by a user, wherein the request task comprises an accessible address and file parameters of a file generated by the user specification; and adding the request task into a corresponding task queue based on the type of the request task, generating a task ID based on the request task, and generating a file specified by the request task according to the request task in the task queue.
In some embodiments, the system further comprises a file server and a service application; the file server is used for receiving the file and obtaining a file ID and a file storage path based on the file; judging whether the file needs to be kept secret, if so, sending the file ID to a local server; otherwise, sending the file ID and the file storage path to a local server;
the local server is further used for obtaining the association information between the file ID and the task ID based on the file ID and the task ID; if the file needs to be kept secret, the associated information and the file ID are sent to a service application end; otherwise, sending the associated information, the file ID and the file storage path to a service application end;
the service application end is used for acquiring the file storage path at the file server end by using the file ID based on the associated information when the file needs to be kept secret; and when the file does not need to be kept secret, based on the associated information, the file ID is used for obtaining the file storage path at the service application end.
In a third aspect, an embodiment of the present application provides a server, where the server includes: a processor and a memory, the memory having stored thereon a computer program operable on the processor, the computer program, when executed by the processor, implementing the method of generating a file according to the first aspect.
In a fourth aspect, the present application provides a storage medium on which a computer program capable of running on a processor is stored, wherein the computer program, when executed by the processor, implements the method for generating a file according to the first aspect.
By adopting the scheme, when the page content is converted into the file with the specified format, the service application terminal firstly generates a request task containing the accessible address and the file parameters of the file which is specified by the user to be generated according to the requirement of the user, and then sends the request task to the local server terminal. The scheme supports the asynchronous generation of files in a specified format by the local server, and the request is completed after the service application end sends the request task without blocking, so that the resources and the capacity of the service application end are effectively saved.
After receiving the request task, the local server adds the request task into the task queue, generates a file specified by the request task based on the request task in the task queue, and stores the file in an directory of the local server. The operation of generating the file which consumes the most CPU and IO resources of the server is abstracted to the local server, so that the CPU and IO resources of the service application end are effectively saved, and the processing performance of the service application end is effectively improved. The method comprises the steps that a local server side generates a file specified by a request task based on the request task in a task queue, monitors the life cycle of file generation, is compatible with the condition of an abnormal request task, and effectively improves the reliability of file generation and the stability of a system. In addition, the file specified by the request task is obtained through the rendering result and the file parameter, the strategy of generating the same file is used, a simple and easy-to-access mode and diversified business scenes are provided, the file parameter of which is set only by paying attention to the sample of the file required to be generated, the complicated details of file generation are not needed to be paid attention to, and the development difficulty and the execution cost of the requirement are effectively reduced.
In order to reduce the dependence of the business application end on the local server end and highly adapt to the business service cluster with the containerization trend, the local server end sends the file to the file server end, and the file server end generates the file ID according to the file. And after the file server is detected to successfully receive the text, removing the text in the local server directory, and reducing the maintenance cost of the local server. In addition, the page display and the file generation are decoupled, the service application end calls the file in the file server end through the file ID, and only the page display result needs to be concerned; the local server only concerns the performance of the local server, so that team cooperation is more efficient and delivery quality is higher.
Drawings
Fig. 1 is a diagram of a system framework for generating a file according to this embodiment.
Fig. 2 is a flowchart of a method for generating a file according to this embodiment.
FIG. 3 is a diagram of a structure of a generated file according to this embodiment
Fig. 4 is a timing diagram of a file generation service provided in this embodiment.
Fig. 5 is a block diagram of the server according to the present embodiment.
Detailed Description
For a clearer understanding of the objects, aspects and advantages of the present application, reference is made to the following description and accompanying drawings. However, it will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. It will be apparent to those of ordinary skill in the art that various changes can be made to the embodiments disclosed herein, and that the general principles defined herein may be applied to other embodiments and applications without departing from the principles and scope of the present application. Thus, the present application is not limited to the embodiments shown, but is to be accorded the widest scope consistent with the scope of the present application as claimed.
The embodiments of the present application will be described in further detail with reference to the drawings.
A server cluster is a loosely coupled collection of compute nodes made up of two or more node machines (servers) that provide a single client view of a network service or application to a user while providing fault recovery capabilities approaching fault tolerance mechanisms. Cluster systems are typically interconnected by two or more node server systems, each cluster node being an independent server running its own process, through respective hardware and software. These processes may communicate with each other as if they form a single system for the network clients, cooperating to provide applications, system resources and data to the user, and the clustered system has the ability to recover from server level failures in addition to serving as a single system. Clustered systems may also internally increase the processing power of servers by continuing to add servers in the cluster, and provide inherent reliability and availability through system-level redundancy.
Before describing a method for generating a file according to an embodiment of the present invention, an application scenario of the embodiment is first described. Fig. 1 is a system framework diagram for generating a file according to this embodiment, and as shown in fig. 1, the system includes a service application end, a local server end, and a file server end. The service application end, the local server end and the file server end are in communication connection with each other.
The service application terminal is used for acquiring a request initiated by a user, acquiring a request task for generating a file based on the request, and sending the request task to the local server terminal, wherein the request task comprises an accessible address and file parameters of the file which is specified by the user and generated.
In this embodiment, the user needs to generate a specified file for the content in the web page, where the content in the web page may be a prescription made by a doctor or a physical examination result. And generating a corresponding PDF file or an Image picture according to the requirement of the user. In a specific application scenario, the service application end is equivalent to the front end.
The local server is used for receiving a request task about generating a file initiated by a user; the method comprises the steps of adding a request task into a task queue based on the type of the request task, generating a task ID based on the request task, generating a file specified by the request task according to the request task in the task queue, and sending the file to a file server.
In a specific application scenario, a plurality of local servers are used for processing request tasks in a task queue, and the local servers are equivalent to a backend.
The file server is used for receiving the file and obtaining a file ID and a file storage path based on the file; judging whether the file needs to be kept secret, if so, sending the file ID to a local server; otherwise, the file ID and the file storage path are sent to the local server.
In a specific application scenario, a file server is equivalent to an object storage center of an OSS, and after a file is uploaded to the OSS, if the file needs to be kept secret, the OSS returns a unique identifier of the file, namely a file ID; if the file does not need to be kept secret, the OSS returns a unique identifier of the file and also provides a function of obtaining an address accessible to the file based on the unique identifier, which is typically an integrated OSS official SDK. The file storage method is used for storing all files generated by the local server, and is convenient for a user to directly search corresponding files from the file server at the business server in the later period.
The local server is also used for obtaining the association information between the file ID and the task ID based on the file ID and the task ID; if the file needs to be kept secret, the association information and the file ID are sent to a service application end; otherwise, the associated information, the file ID and the file storage path are sent to the service application end.
The service application end is also used for acquiring a file storage path at the file server end by using the file ID based on the associated information when the file needs to be kept secret; and when the file does not need to be kept secret, obtaining a file storage path at a service application end by using the file ID based on the associated information.
Because the OSS generates a plurality of file storage addresses, but the files do not correspond to the tasks one to one, and the association information between the file ID and the task is established, the storage path of the file can be obtained according to the file ID. In addition, if the file needs to be kept secret, the business application end can only use the file ID to obtain the storage path corresponding to the file at the file server end based on the associated information; if the file does not need to be kept secret, a plurality of file IDs and a plurality of file storage paths are stored in the service application end, and the service application end can obtain the storage paths of the file in the service application end by using the file IDs which the service application end wants to know based on the associated information.
Next, a method for generating a file in this embodiment is described, where the method is applied to the above system, fig. 2 is a flowchart of a method for generating a file provided in this embodiment, and as shown in fig. 2, the method includes the following steps:
step S201, the local server receives a request task about generating a file initiated by a user, wherein the request task comprises an accessible address and file parameters of the generated file specified by the user.
The accessible address of the file specified by the user is one of a CDN address or a URL address of the web page, and may be specifically determined according to actual needs of the user. The method supports two access modes, one is a directly accessible webpage address, namely a URL (uniform resource locator) address, the other is that webpage content is uploaded to a CDN (content delivery network) server as a file, and the CDN address is a webpage address, namely a CDN address. This may be convenient for the user, as long as a static web address is provided, if the web content does not want other web sites to be accessible online. When the web address is a pure file, it is generally more convenient to place the web address on the CDN. Determining whether the CDN address is fixed according to whether a link of a user is private, and if the link belongs to a private link, fixing the CDN address; otherwise, the CDN address is not fixed.
In addition, the file parameters include, but are not limited to, text size, arrangement style, whether header and footer are displayed, header and footer customized content, and the like, wherein if the file format is PDF, the file parameters may also include page margin and line spacing; if the file format is Image, the file format may further include pixels, size, color, presence or absence of special effects, and the like. The request task may include, besides the accessible address and the file parameter, a script that the file should be injected before being generated, a file name that the file should be displayed when downloading the file, whether the file allows public access, and the like according to actual situations. And after the business application side formulates the request task, sending the request task to the local server side in an HTTPS mode.
And the local server receives the request task sent by the service application terminal in real time, and adds the request task into a corresponding task queue based on the type of the request task. For example, one type of the request task is CDN address + prescription service + PDF format, and the other type is CDN address + prescription service + Image format, where the two types of the request tasks are not the same, and the required file parameter attributes may also be different. Therefore, in order to facilitate the processing operation on the request task quickly and accurately, the different types of request tasks need to be added into different task queues, so that the request tasks in the task queues all belong to the same type.
Step S202, the request task is added into a corresponding task queue based on the type of the request task, a task ID is generated based on the request task, a file specified by the request task is generated according to the request task in the task queue, and the file is sent to a file server.
After the task to be requested is added to the task queue, the local server generates a task ID of the task to be requested, and sends the task ID to the service application end. And after the service application end receives the ID of the task, the task is successfully submitted, and the work of sending the request task by the service application end is finished. That is, this embodiment supports asynchronous generation of a file in a specified format, and after the service application end sends a request task, the request is completed without blocking, thereby effectively saving resources and capabilities of the service application end.
In the process of generating a file specified by a request task based on the request task in a task queue, firstly, judging whether the request task to be processed is in the task queue, if so, automatically triggering a consumption mechanism of the task queue to obtain the request task to be processed, wherein other request tasks in the task queue need to be queued for waiting, and after the previous request task is processed, processing the next request task in the task queue. On one hand, the request tasks to be processed in the task queue can be determined according to the sequence of adding the request tasks into the task queue, namely, the request tasks added into the task queue at the earliest are processed preferentially; on the other hand, the priority of processing the request task can be adjusted according to the importance of the request task, and if the current service belongs to the core service, the priority of the request task in the task queue is improved, and the processing is performed preferentially.
And then rendering the request task needing to be processed based on the webpage accessible address corresponding to the request task needing to be processed to obtain a visual image.
When processing a request task to be processed, the node starts a headless browser, sets a browser start parameter, requests to load a page accessible address which is expected to be rendered, and feeds back a visual image to a local server after rendering of the headless browser is completed, that is, after the page accessible address is loaded. The startup script of the headless browser may be referred to in setting browser startup parameters, which are set depending on which extensions are provided by the headless browser.
The method comprises the steps of monitoring whether a request task to be processed is abnormal in a life cycle or not in the process of rendering the request task to be processed based on an accessible address corresponding to the request task to be processed, if so, acquiring a server node where the abnormal request task occurs, and distributing all uncompleted request tasks in the server node to other server nodes, namely, performing service isolation on a task queue, so as to avoid the influence on other request tasks caused by abnormal use of one request task.
The local server declares processing events of each life cycle, such as page load, page document load, page error, request failed, request finished, response and the like, in a page rendering process based on node. In the process that the local server generates the file specified by the request task based on the request task in the task queue, the life cycle of file generation is monitored, the condition of an abnormal request task is compatible, and the reliability of file generation and the stability of a system are effectively improved.
Preferably, in order to timely learn the progress of the request task, the service application side may also query the progress of the request task at the local server according to the task ID.
In addition, after monitoring that a request task needing to be processed is abnormal in a life cycle, the system can automatically retry for a plurality of times, if all the tasks fail, the system can notify a server developer and a user through third-party software, wherein the third-party software can be enterprise WeChat, QQ, nail and the like.
And finally, acquiring the file specified by the request task according to the visual image and the file parameter.
After the page rendering is finished, the local server also calls the node.js SDK, sets various parameters required for generating the file, directly generates the specified file by the browser, and stores the specified file in the specified local temporary directory. The files specified by the request task are obtained through the rendering result and the file parameters, a simple and easy-to-access mode and diversified service scenes are provided by using the strategy of generating the same file, the file parameters of which are set only by paying attention to the sample of the file required to be generated by the user, the complicated details of file generation are not needed to be paid attention to, and the development difficulty and the execution cost of the requirement are effectively reduced. In addition, the embodiment abstracts the operation of the generated file in the most consumed server CPU and IO resources to the local server, thereby effectively saving the CPU and IO resources of the service application terminal and effectively improving the processing performance of the service application terminal.
In one embodiment, the step of sending the file to the file server comprises the steps of storing the file by the local server, sending the file to the file server, and deleting the file by the local server after the file server successfully receives the file.
After the local server generates a file, the file is preferentially stored in the local server, after all the request tasks needing to be processed are completed, the browser is closed, the file generated by the local server is uploaded to the file server, after the file server successfully receives the file, the file server generates a file ID of the file and sends the file ID to the local server, the file server is characterized in that the file server successfully receives the file, and at the moment, the local server deletes the file which is successfully uploaded to the file server. After the file server side is ensured to successfully receive the file generated by the local server side, the association between the task ID and the file ID is persisted, and the file in the local server side is deleted, so that on one hand, the maintenance cost of the local server side can be relieved, and on the other hand, a server CPU and IO (input output) resources of the local server side can generate a text better.
In addition, if the service needs to ensure the privacy of the file, when the file generated by the local server is uploaded to the file server, the file is set as the private file uploading, and the technologies of file anti-theft chain, link timeliness and the like can be combined, so that the situation that the private file generated by the local server can be randomly accessed is avoided.
After the local server sends the file to the file server, the file server obtains a file ID and a file storage path based on the file; if the file needs to be kept secret, the file server sends the file ID to the local server, the local server obtains the association information between the file ID and the task ID on the basis of the file ID and sends the association information and the file ID to the service application end, and the service application end obtains a file storage path at the file server by using the file ID on the basis of the association information; if the file does not need to be kept secret, the file server sends the file ID and the file storage path to the local server, the local server obtains the association information between the file ID and the task ID based on the file ID and sends the association information, the file ID and the file storage path to the service application end, and the service application end uses the file ID to obtain the file storage path at the service application end based on the association information.
After receiving the file, the file server can distinguish whether the service application end can directly obtain the file storage path according to whether the file needs to be kept secret. When the file is required to be kept secret, the file server sends the file ID and simultaneously sends the file storage path, and when the file is required to be kept secret, the file server generates the file storage path at the same time, but does not send the file ID and stores the file storage path in the file server, and at the moment, a user is required to use the file ID to exchange an accessible path based on the related information when using the file. Therefore, files can be prevented from being randomly diffused and quoted to public scenes such as microblogs and blogs. The local server sends the file to the file server, so that the file server generates the file ID according to the file. After the file server is detected to successfully receive the text, the text under the local server directory is removed, and the maintenance cost of the local server is reduced. In addition, the page display and the file generation are decoupled, the service application end calls the file in the file server end through the file ID, and only the page display result needs to be concerned; the local server only concerns the performance of the local server, so that team cooperation is more efficient and delivery quality is higher.
Fig. 3 is a structural diagram of generating a file according to this embodiment, and as shown in fig. 3, the structure includes a service application end cluster, a local server end cluster, and a file server end center. The service application end cluster comprises a service access port and a server, and the service application end cluster, the local server end cluster and the file server end center are in communication connection with each other.
The service access port in the service application end cluster receives various service requests of a user, the service in this embodiment includes a prescription service, a physical examination service, and the like, and the service request includes converting the prescription service into a PDF, converting the prescription service into a picture, converting a physical examination report into a PDF, and converting the physical examination report into a picture. And then, the server in the service application end cluster generates a request task containing a webpage accessible address and file parameters of a file generated by user specification according to user requirements. The service application end cluster is a client.
The local server cluster is used for adding tasks in the business application end cluster into different task queues for processing, and comprises a plurality of browsers, wherein each browser corresponds to one server node, and the browsers are used for processing the tasks in the task queues to generate corresponding files, such as PDF files and Image files. And sends the file to the file server.
The file server is used for receiving the file and generating a file ID and a file storage path based on the file. All files which are finished in the system are stored in the file server, each file has a file ID, and the service application end cluster and the file server are in communication connection, so that the service application end cluster can obtain a path of the corresponding file according to the file ID based on the associated information to access.
Fig. 4 is a timing diagram of a file generation service provided in this embodiment. As shown in fig. 4, firstly, the service application end will request a request task of converting the specified address into PDF or a picture to be sent to the local server end; then the local server creates a task and adds the task into a task queue, then opens the headless browser, requests to load the specified address, and returns the result of the loading completion to the local server after the processing of the headless browser is completed; the local server side continues to provide file parameters for the headless browser, requests for converting the page into a file, and stores the file in a path designated by the local server side after the headless browser generates the file; in order to relieve the maintenance pressure of the local server, the local server uploads the generated file to the file server for storage, and the file server sends the file ID to the local server after successful storage. The local server establishes a connection between the file ID and the task ID and returns the connection to the service application end, so that the service application end can use the file ID to access the file.
Fig. 5 is a block diagram of a server provided in this embodiment, and as shown in fig. 5, the server includes a processor 51 and a memory 52, where the memory 52 stores a computer program 53 that can run on the processor 51, and when the computer program 53 is executed by the processor, the method for recommending environmental regulations for an enterprise according to this embodiment is implemented.
The memory 52 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a random access memory, or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read only memory, a read only optical disk or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 52 may be an internal storage unit in some embodiments.
The processor 51 may be a central processing unit, general purpose processor, data signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, transistor logic device, hardware component, or any combination thereof. For executing program code stored in memory 52 or processing data.
The processor 51 and the memory 52 are connected by a bus. A bus may include a path that carries information between the components. The bus may be a peripheral component interconnect standard bus or an extended industry standard architecture bus or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
Fig. 5 shows only a server with a memory 52, a processor 51 and a bus, and it is understood in the art that the structure shown in fig. 5 does not constitute a limitation to the server, and may be a bus structure or a star structure, and the server may include more or less components than those shown, or combine certain components, or arrange different components. Other electronic devices now known or later developed, as applicable, are intended to be included within the scope of protection and are hereby incorporated by reference.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein.
The foregoing is only a partial embodiment of the present application, and it should be noted that, for those skilled in the art, several modifications and decorations can be made without departing from the principle of the present application, and these modifications and decorations should also be regarded as the protection scope of the present application.

Claims (10)

1. A method of generating a file, the method comprising:
the method comprises the steps that a local server receives a request task for generating a file initiated by a user, wherein the request task comprises an accessible address and file parameters of the file generated by the user specification;
and adding the request task into a corresponding task queue based on the type of the request task, generating a task ID based on the request task, generating a file specified by the request task according to the request task in the task queue, and sending the file to a file server.
2. The method of claim 1, wherein sending the file to a file server comprises:
the file server obtains a file ID and a file storage path based on the file;
judging whether the file needs to be kept secret, if so, sending the file ID to the local server by the file server, obtaining association information between the file ID and the task ID by the local server based on the file ID and the task ID, and sending the association information and the file ID to a service application end, and acquiring the file storage path at the file server by the service application end based on the association information by using the file ID;
otherwise, the file server sends the file ID and the file storage path to the local server, the local server obtains the association information between the file ID and the task ID based on the file ID and sends the association information, the file ID and the file storage path to a service application end, and the service application end obtains the file storage path at the service application end based on the association information by using the file ID.
3. The method of claim 1, wherein the generating the file specified by the requesting task according to the requesting task in the task queue comprises:
judging whether the request tasks to be processed exist in the task queue, if so, automatically triggering a consumption mechanism of the task queue to obtain the request tasks to be processed;
rendering the request task needing to be processed based on the webpage accessible address corresponding to the request task needing to be processed to obtain a visual image;
and acquiring the file specified by the request task according to the visual image and the file parameter.
4. The method according to claim 3, wherein the rendering the requested task needing to be processed based on the accessible address corresponding to the requested task needing to be processed comprises:
and monitoring whether the request tasks needing to be processed are abnormal in the life cycle, if so, acquiring the server nodes where the abnormal request tasks are positioned, and distributing all the incomplete request tasks in the server nodes to other server nodes.
5. The method of claim 1, wherein generating a task ID based on the requested task further comprises obtaining a progress of the requested task based on the task ID.
6. The method of claim 1, wherein sending the file to a file server comprises:
and the local server stores the file and sends the file to the file server, and the local server deletes the file after the file server successfully receives the file.
7. A system for generating files, the system comprising a local server; wherein the content of the first and second substances,
the local server is used for receiving a request task about generating a file initiated by a user, wherein the request task comprises an accessible address and file parameters of the file generated by the user specification; and adding the request task into a corresponding task queue based on the type of the request task, generating a task ID based on the request task, and generating a file specified by the request task according to the request task in the task queue.
8. The system of claim 7, further comprising a file server and a business application; wherein the content of the first and second substances,
the file server is used for receiving the file and obtaining a file ID and a file storage path based on the file; judging whether the file needs to be kept secret, if so, sending the file ID to a local server; otherwise, sending the file ID and the file storage path to a local server;
the local server is further used for obtaining the association information between the file ID and the task ID based on the file ID and the task ID; if the file needs to be kept secret, the associated information and the file ID are sent to a service application end; otherwise, sending the associated information, the file ID and the file storage path to a service application end;
the service application end is used for acquiring the file storage path at the file server end by using the file ID based on the associated information when the file needs to be kept secret; and when the file does not need to be kept secret, based on the associated information, the file ID is used for obtaining the file storage path at the service application end.
9. A server, characterized in that the server comprises: a processor and a memory, the memory having stored thereon a computer program operable on the processor, the computer program, when executed by the processor, implementing a method of generating a file as claimed in any one of claims 1 to 6.
10. A storage medium having stored thereon a computer program operable on a processor, the computer program, when executed by the processor, implementing a method of generating a file as claimed in any one of claims 1 to 6.
CN202210813061.4A 2022-07-12 2022-07-12 Method, system, server and storage medium for generating file Pending CN115242777A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210813061.4A CN115242777A (en) 2022-07-12 2022-07-12 Method, system, server and storage medium for generating file

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210813061.4A CN115242777A (en) 2022-07-12 2022-07-12 Method, system, server and storage medium for generating file

Publications (1)

Publication Number Publication Date
CN115242777A true CN115242777A (en) 2022-10-25

Family

ID=83671033

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210813061.4A Pending CN115242777A (en) 2022-07-12 2022-07-12 Method, system, server and storage medium for generating file

Country Status (1)

Country Link
CN (1) CN115242777A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100011289A1 (en) * 2008-07-09 2010-01-14 Theladders.Com, Inc. Method and system for document viewing
CN109165357A (en) * 2018-09-07 2019-01-08 北京三快在线科技有限公司 Picture Generation Method, server, electronic equipment and readable storage medium storing program for executing
CN110008195A (en) * 2019-04-11 2019-07-12 重庆猪八戒知识产权服务有限公司 A kind of dynamic configuration html turns the method, apparatus and system of pdf
CN112988350A (en) * 2021-03-01 2021-06-18 网易(杭州)网络有限公司 Data task processing method and device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100011289A1 (en) * 2008-07-09 2010-01-14 Theladders.Com, Inc. Method and system for document viewing
CN109165357A (en) * 2018-09-07 2019-01-08 北京三快在线科技有限公司 Picture Generation Method, server, electronic equipment and readable storage medium storing program for executing
CN110008195A (en) * 2019-04-11 2019-07-12 重庆猪八戒知识产权服务有限公司 A kind of dynamic configuration html turns the method, apparatus and system of pdf
CN112988350A (en) * 2021-03-01 2021-06-18 网易(杭州)网络有限公司 Data task processing method and device and electronic equipment

Similar Documents

Publication Publication Date Title
US7216142B2 (en) Network application program interface facilitating communication in a distributed network environment
JP3470955B2 (en) Method and apparatus for transferring data
US9459888B2 (en) Implementing browser based hypertext transfer protocol session storage
CN110580305B (en) Method, apparatus, system and medium for generating identifier
US20110320889A1 (en) Server Reachability Detection
CN114363407B (en) Message service method and device, readable storage medium and electronic equipment
WO2017016408A1 (en) Service invocation-based fault handling method, device and system
US20120102479A1 (en) Automated service version upgrading
CN114281263B (en) Storage resource processing method, system and equipment of container cluster management system
CN111510330B (en) Interface management device, method and storage medium
CN108475220B (en) System and method for integrating a transactional middleware platform with a centralized audit framework
JP2006004415A (en) Flexible context management for enumerating session using context replacement
CN111800511B (en) Synchronous login state processing method, system, equipment and readable storage medium
US9178960B2 (en) Recovering resource connections
CN111338829B (en) Calling method and device for remote procedure call service
Goscinski et al. Toward higher level abstractions for cloud computing
CN115242777A (en) Method, system, server and storage medium for generating file
WO2019201111A1 (en) Information processing method, apparatus and device, and computer-readable storage medium
CN111835809A (en) Work order message distribution method, work order message distribution device, server and storage medium
US20230093004A1 (en) System and method for asynchronous backend processing of expensive command line interface commands
CN114860473A (en) Message processing method, processor and storage medium
CN112597224A (en) Data export method, data export device, electronic equipment and medium
CN114817166B (en) Method, device and medium for canceling file operation
US11392433B1 (en) Generation of asynchronous application programming interface specifications for messaging topics
CN116010126B (en) Service aggregation method, device and 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