Document generation method, system and equipment and storage medium
By generating offline documents and converting them into online documents when the online document service is available, the problem of lag and time consumption caused by the unavailability of the online document service is solved, thus improving document generation efficiency and user experience.
Patent Information
- Application Number
- CN202410963494.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-17
- Publication Date
- 2026-01-20
AI Technical Summary
Existing online document services are prone to lag, malfunctions, or crashes during the generation and export process, making them unusable. Regenerating offline documents is time-consuming, affecting work efficiency and user experience.
In response to a document generation request, first generate an offline document and check the status of the online document service. If it is available, convert it to an online document; otherwise, directly provide an offline document. This pre-generates offline documents for later use, avoiding the need to regenerate the document.
It reduces the adverse effects of online document service unavailability, improves document generation efficiency and user experience, and reduces delays caused by service unavailability.
Smart Images

Figure CN121365658A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of documents, and in particular to a document generation method, system, device and storage medium. BACKGROUND
[0002] At present, with the rapid development of information technology, related applications have gradually been integrated into people's lives, providing people with various services. For example, in the field of document technology, there is an online document application. Online documents generally support multi-person collaborative editing and common browsing, and have wide application prospects in team office, file sharing and project management construction businesses, which can improve work efficiency and multi-person collaboration capabilities.
[0003] In the prior art, when generating an online document, an object-based document generation request is generally applied to generate an online document using related business data and export it. The exported online document can be easily browsed or edited, and the edited content can be immediately reflected in the online document. However, it is found that the application of online document services may have abnormal situations such as lag, failure or crash, and is often unavailable. In this case, the online document cannot be normally exported for use, and if an offline document is generated and exported based on the business data again, the overall time consumption is relatively long, which affects the work efficiency and the user experience of the object.
[0004] In summary, the technical problems existing in the prior art need to be improved. SUMMARY
[0005] The embodiments of the present application provide a document generation method, system, device and storage medium, which can reduce the adverse effects of the unavailability of online document services and improve the generation efficiency and user experience of documents.
[0006] An aspect of an embodiment of the present application provides a document generation method, which comprises:
[0007] In response to a document generation request of a target object, target business data corresponding to the document generation request is obtained;
[0008] According to the target business data, an offline document is generated to obtain an offline document corresponding to the target business data;
[0009] It is detected whether the current online document service is in an available state;
[0010] If the current online document service is in an available state, the offline document is converted into an online document using the online document service, and the online document is fed back to the target object;
[0011] if the current online document service is in an available state, converting the offline document into an online document by using the online document service, and feeding back the online document to the target object.
[0012] In another aspect, an embodiment of the present application provides a document generation system, which comprises:
[0013] an acquisition unit, configured to acquire target business data corresponding to a document generation request of a target object in response to the document generation request of the target object;
[0014] a generation unit, configured to generate an offline document corresponding to the target business data according to the target business data;
[0015] a detection unit, configured to detect whether a current online document service is in an available state;
[0016] a conversion unit, configured to convert the offline document into an online document by using the online document service if the current online document service is in the available state, and feed back the online document to the target object;
[0017] a processing unit, configured to feed back the offline document to the target object if the current online document service is in an unavailable state, update the offline document according to an editing operation of the target object, and convert the updated offline document into an online document by using the online document service and feed back the online document to the target object once the online document service becomes in the available state.
[0018] Optionally, the acquisition unit is specifically configured to:
[0019] receive the document generation request of the target object;
[0020] analyze the document generation request, and determine that the document generation request indicates a belonging object corresponding to the exported business data;
[0021] acquire identification information of the belonging object, and collect the target business data according to the identification information;
[0022] The processing unit is further configured to:
[0023] feed back the online document to the belonging object.
[0024] Optionally, the system further comprises a configuration unit, which is specifically configured to:
[0025] receive export configuration information input by a first object; the export configuration information comprises a business name of an executable data export service and data address and data format corresponding to the business name;
[0026] The acquisition unit is specifically configured to:
[0027] receiving a document generation request of a target object, determining a target service name requiring to perform a data export service according to the document generation request;
[0028] determining a target data address and a target data format corresponding to the target service name from the export configuration information;
[0029] obtaining target service data corresponding to the document generation request according to the target data address and the target data format.
[0030] Optionally, the obtaining unit is specifically configured to:
[0031] obtaining original service data according to the target data address;
[0032] parsing the target data format to determine a target field name and a target field type specified by the export configuration information;
[0033] searching for field content matching the target field name and the target field type in the original service data to obtain the target service data.
[0034] Optionally, the obtaining unit is specifically configured to:
[0035] constructing a matching tree model based on an automatic machine according to the target field name;
[0036] inputting characters in the original service data into the matching tree model to detect whether there is a character combination matching the target field name in the original service data;
[0037] if there is a character combination matching the target field name in the original service data, obtaining a field value corresponding to the character combination;
[0038] if the type of the field value is the target field type, determining the character combination and the field value as field content matching the target field name and the target field type.
[0039] Optionally, the detecting unit is specifically configured to:
[0040] performing online conversion on the offline document through the online document service, and recording a starting time node of a task of starting to perform the online conversion;
[0041] detecting whether the task of the online conversion generates the online document;
[0042] if a time length from a current time node to the starting time node exceeds a first threshold value, and the task of the online conversion does not generate the online document, determining that the online document service is currently in an unavailable state.
[0043] Optionally, the detecting unit is specifically configured to:
[0044] detect a historical time node of a last time when an inquiry signal is sent, wherein the inquiry signal is used to inquire whether the online conversion task generates the online document;
[0045] if the inquiry signal sent last time indicates that the online conversion task does not generate the online document, and a time length from a current time node to the historical time node reaches a second threshold, re-send the inquiry signal, and return to execute the step of detecting the historical time node of the last time when the inquiry signal is sent.
[0046] Optionally, the converting unit is specifically configured to:
[0047] if the online document service is currently in an available state, generate a first asynchronous task, wherein the first asynchronous task is used to convert the offline document into the online document;
[0048] execute the first asynchronous task, and return a first task identifier of the first asynchronous task;
[0049] periodically poll a completion state of the first asynchronous task according to the first task identifier through the online document service, and obtain the online document.
[0050] Optionally, the system further comprises an executing unit, and the executing unit is specifically configured to:
[0051] in response to a document generation request of the target object, generate a second asynchronous task, wherein the second asynchronous task is used to execute a document generation task corresponding to the document generation request;
[0052] feed back prompt information to the target object, wherein the prompt information is used to inform the target object of a target channel for receiving the online document or the offline document;
[0053] execute the second asynchronous task, and feed back the online document or the offline document to the target object through the target channel.
[0054] Optionally, the processing unit is further configured to:
[0055] update the offline document according to an editing operation of the target object, and once the online document service becomes available, convert the updated offline document into an online document by using the online document service, and feed back the online document to the target object.
[0056] Optionally, the processing unit is specifically configured to:
[0057] acquire a state parameter of the online document service;
[0058] based on the state parameter, predict a fault recovery time of the online document service through a prediction model;
[0059] poll a state of the online document service according to the fault recovery time, so as to convert the updated offline document into an online document through the online document service and feed back the online document to the target object when it is determined that the online document service becomes available.
[0060] In another aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory;
[0061] The memory is configured to store a computer program.
[0062] The processor executes the computer program to implement the aforementioned document generation method.
[0063] In another aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the aforementioned document generation method.
[0064] In another aspect, an embodiment of the present application further provides a computer program product, which comprises a computer program stored in a computer readable storage medium, and a processor of a computer device reads the computer program from the computer readable storage medium, and the processor executes the computer program to enable the computer device to implement the aforementioned document generation method.
[0065] The embodiments of the present application at least have the following beneficial effects: the present application provides a document generation method, system, device and storage medium, and in response to a document generation request of a target object, the present application acquires target business data corresponding to the document generation request, generates a corresponding offline document according to the target business data, and then detects whether a current online document service is available, and if available, generates an online document through online conversion based on the offline document; if not available, first feeds back the offline document for the target object to edit, so as to reduce the adverse effects caused by unavailability of the online document service. Moreover, the present application can generate an offline document in advance, and the target object does not need to re-initiate a document generation request when discovering that the online document service is unavailable, so as to improve the generation efficiency of the document and the use experience. BRIEF DESCRIPTION OF DRAWINGS
[0066] The accompanying drawings are used to provide a further understanding of the technical solutions of the present application, and constitute a part of the specification, and are used to explain the technical solutions of the present application together with the embodiments of the present application, and do not constitute a limitation to the technical solutions of the present application.
[0067] Figure 1 A storage and use environment schematic diagram of an online document provided in an embodiment of the present application;
[0068] Figure 2 A system architecture diagram to which a document generation method provided in an embodiment of the present application is applied;
[0069] Figure 3 A schematic diagram of employee punch data arrangement through online document application provided in an embodiment of the present application;
[0070] Figure 4 A schematic diagram of performance display through online document provided in an embodiment of the present application;
[0071] Figure 5 A flowchart of a document generation method provided in an embodiment of the present application;
[0072] Figure 6 An interaction schematic diagram of generating an offline document provided in an embodiment of the present application;
[0073] Figure 7 An interaction schematic diagram of asynchronous processing of online conversion tasks of offline documents provided in an embodiment of the present application;
[0074] Figure 8 An interaction schematic diagram of asynchronous processing of document generation tasks provided in an embodiment of the present application;
[0075] Figure 9 An interaction schematic diagram of asynchronous processing of document generation tasks through export configuration information provided in an embodiment of the present application;
[0076] Figure 10 A structural block diagram of a document generation system provided in an embodiment of the present application;
[0077] Figure 11 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0078] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0079] It can be understood that the terms "first", "second", and the like used in the present application can be used herein to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another.
[0080] As used herein, the terms “at least one”, “multiple”, “each”, “any”, and the like, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding plurality, and any refers to any one of the plurality.
[0081] Before further detailing the embodiments of the present application, the terms and phrases involved in the embodiments of the present application are explained, and the terms and phrases involved in the embodiments of the present application are applicable to the following explanations:
[0082] 1) Markdown, a lightweight markup language that allows people to write documents in a readable and easy-to-write plain text format, and then convert them into structured HTML (HyperText Markup Language) documents. The syntax of Markdown is simple and clear, aiming to make the writing of documents more simple and intuitive, while not losing the ability of formatting.
[0083] 2) URL, the abbreviation of Uniform Resource Locator, commonly known as Uniform Resource Locator in Chinese. It is the unique address of the resource on the Internet, used to identify and locate resources on the Internet.
[0084] 3) Artificial Intelligence (AI) is to use digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology of computer science, which tries to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines, so that machines have the functions of perception, reasoning and decision-making.
[0085] Artificial intelligence technology is a comprehensive discipline, involving a wide range of fields, both hardware and software technologies. Artificial intelligence basic technologies generally include sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-training model technology, operation / interaction system, mechatronics, etc. Among them, the pre-training model is also called large model, basic model, which can be widely applied to downstream tasks in various directions of artificial intelligence after fine-tuning. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology and machine learning / deep learning, etc.
[0086] 4) Machine Learning (ML) is a multi-disciplinary subject, involving probability theory, statistics, approximation theory, convex analysis, algorithmic complexity theory, etc. It is a specialized study of how computers simulate or implement human learning behavior to acquire new knowledge or skills, reorganize existing knowledge structure, and continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental approach to making computers intelligent, and its applications are widespread in various fields of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and rule-based learning. Pre-trained models are the latest development in deep learning, integrating the above technologies.
[0087] Currently, with the rapid development of information technology, related applications have gradually been integrated into people's lives, providing a variety of services for people. For example, in the field of document technology, there are applications of offline documents and online documents. Generally, offline documents usually refer to locally stored documents, which can be stored on the hard disk or other local storage devices of terminal devices, such as Word, Excel, PDF, etc. These documents can be viewed and edited without network connection. For example, a user can install a document application software through a related terminal device, and based on the document application software, the offline document can be directly opened, browsed or edited without the need for internet connection.
[0088] Of course, it should be noted that the acquisition, use and storage of offline documents do not necessarily have to be performed in an offline environment, i.e. the processing flow related to offline documents does not necessarily require internet connection. For example, in some scenarios, an offline document may be stored in a server after being generated. If a user wants to obtain the offline document, he needs to establish a communication connection between the terminal device and the server, and then download the offline document from the server. In this scenario, internet connection may be required to obtain the offline document, which is not limited in the present application.
[0089] Online documents, also known as cloud documents or network documents, are generally stored on an internet server, as shown in Figure 1 , Figure 1 An online document storage and use environment provided in an embodiment of the present application is shown. As shown in Figure 1 , the online document is generally stored in a cloud server 140, and multiple different collaboration objects can jointly browse and edit the online document. Specifically, each collaboration object can log in to the application to which the online document belongs using a different terminal device, and then use the terminal device to realize the browsing and editing of the online document. For example, Figure 1The three collaborative objects are respectively denoted as a first collaborative object 110, a second collaborative object 120 and a third collaborative object 130, wherein the first collaborative object 110 and the second collaborative object 120 use a computer as an operation device to process the online document, and the third collaborative object 130 uses a mobile phone as an operation device to process the online document.
[0090] Of course, Figure 1 The illustrated case is only used for exemplarily introducing the use mode of the online document, and does not mean limitation. It is easy to understand that the number of collaborative objects of the actual online document can be two or any number more than two, and the application does not limit the type of terminal device used by different collaborative objects.
[0091] It can be understood that, due to supporting multi-person online browsing and editing creation, the online document has wide application prospects in team office, file sharing and project management construction and other businesses, and can improve work efficiency and multi-person collaboration capability.
[0092] It should be noted that when generating the online document, an object-based document generation request is generally applied to generate the online document using related business data and export. The exported online document can be conveniently browsed or edited, and the edited content can be immediately reflected in the online document. However, it is found that the currently applied online document service may have abnormal situations such as lag, failure or crash, and is often unavailable. In this case, the online document cannot be normally exported and used, and if the offline document is generated and exported again based on the business data, the overall time consumption is relatively long, which affects work efficiency and the use experience of the object is not good.
[0093] Therefore, in the embodiment of the application, a document generation method is provided. In response to a document generation request of a target object, target business data corresponding to the document generation request is acquired. The corresponding offline document is generated according to the target business data. Then it is detected whether the current online document service is available. If the online document service is available, the online document is generated through online conversion based on the offline document. If the online document service is not available, the offline document is fed back to the target object for editing, which can reduce the adverse effects caused by the unavailability of the online document service. Moreover, the offline document can be generated in advance, and the target object does not need to initiate a document generation request again when discovering that the online document service is unavailable, which can improve the generation efficiency of the document and the use experience.
[0094] System architecture and scenario applied by the embodiment of the application
[0095] Figure 2 The system architecture diagram to which the document generation method provided by the embodiment of the application is applied, which comprises a terminal device 240, an Internet 230, a gateway 220, a background server 210 and the like.
[0096] In the embodiment of the present application, the terminal device 240 can install and run related applications. For the document generation method provided by the present application, the application installed on the terminal device 240 can include a program application related to an online document. The terminal device 240 can include a desktop computer, a laptop computer, a PDA (personal digital assistant), a mobile phone, a vehicle-mounted terminal, a home theater terminal, a special terminal, and the like. In addition, it can be a single device or a collection of multiple devices. The terminal device 240 can communicate with the Internet 230 in a wired or wireless manner and exchange data.
[0097] The background server 210 refers to a computer system that can provide certain services to the terminal device 240. Compared with the ordinary terminal device 240, the background server 210 has higher requirements in stability, security, performance, and the like. The background server 210 can be a high-performance computer in a network platform, a cluster of multiple high-performance computers, a part of a high-performance computer (for example, a virtual machine), a combination of parts of multiple high-performance computers (for example, virtual machines), and the like.
[0098] The gateway 220 is also called an inter-network connector or a protocol converter. The gateway realizes network interconnection at the transport layer and is a computer system or device that acts as a conversion function. The gateway is a translator between two systems using different communication protocols, data formats or languages, or even completely different architectures. At the same time, the gateway can also provide filtering and security functions. The message sent by the terminal device 240 to the background server 210 is sent to the corresponding background server 210 through the gateway 220. The message sent by the background server 210 to the terminal device 240 is also sent to the corresponding terminal device 240 through the gateway 220.
[0099] The document generation method provided by the embodiment of the present application can be executed independently on the terminal device 240 or based on data interaction between the terminal device 240 and the background server 210.
[0100] The document generation method provided by the embodiment of the present application can be executed in various scenarios, which will be exemplarily described below.
[0101] (I) Attendance summary scenario
[0102] Currently, with the continuous development of information technology, the way of employee office is also changing. In the prior art, there is a demand for collaborative office, which refers to a working mode in which multiple employees at different locations, different times or different time zones complete work tasks through the Internet and related online office applications. The scenario of collaborative office can cover various industries and fields, such as team collaboration, remote office, cross-region collaboration, remote meeting, etc. The document generation method provided in the embodiments of the present application can be applied to the scenario of collaborative office.
[0103] Exemplarily, refer to Figure 3 , Figure 3 A schematic diagram of employee clock-in data arrangement through an online document application is shown in the embodiments of the present application. As shown in Figure 3 , an enterprise can export employee clock-in report data through a related application, and generate a corresponding online document (such as an online table). Each employee can browse his / her own clock-in record through the online table, fill in confirmation information or appeal for exception, so as to improve the efficiency of summarizing and displaying attendance data.
[0104] For the above application scenario, the document generation method provided in the embodiments of the present application can be used to generate related online documents and offline documents, which are provided for employees of an enterprise to use.
[0105] (II) Performance display scenario
[0106] Exemplarily, refer to Figure 4 , Figure 4 A schematic diagram of performance display through an online document is shown in the embodiments of the present application. As shown in Figure 4 , an enterprise can generate an online document through the document generation method provided in the embodiments of the present application to summarize and display the performance results of each business department. The generated online document can be simultaneously browsed and watched by employees of multiple departments online, which can improve the display efficiency of the document. When the online document cannot be normally generated, offline documents can also be distributed for propaganda and display, which can reduce the adverse effects caused by the unavailability of the online document service.
[0107] Overall description of the embodiments of the present application
[0108] Refer to Figure 5 , Figure 5 A flowchart of a document generation method is shown in the embodiments of the present application. As shown in Figure 5 , according to the document generation method of one embodiment of the present application, the method comprises the following steps:
[0109] Step 510, in response to a document generation request of a target object, obtaining target business data corresponding to the document generation request;
[0110] Step 520, generating an offline document according to the target business data, to obtain an offline document corresponding to the target business data;
[0111] Step 530, detecting whether the current online document service is in an available state;
[0112] Step 540, if the current online document service is in the available state, converting the offline document into an online document by using the online document service, and feeding back the online document to the target object;
[0113] Step 550, if the current online document service is in an unavailable state, feeding back the offline document to the target object.
[0114] Firstly, the overall application of the embodiments of the present application and the above steps 510 to 550 are briefly described.
[0115] In the embodiments of the present application, the object that performs the document generation task is recorded as a target object, which can be a single person, or other behavior subjects such as intelligent robots, enterprises, organizations, etc., which are not limited by the present application.
[0116] In step 510, when the target object has a demand for document generation, a request can be triggered, which is recorded as a document generation request in the embodiments of the present application. It can be understood that the demand for document generation can come from various work flows or business operations. For example, in an enterprise environment, when an employee needs to create a report, a contract, a proposal or a project, there can be a demand for document generation. The target object can trigger the document generation request by interacting with the terminal device. Specifically, the terminal device can receive the interaction instruction of the target object to the related component, and take the interaction instruction as the instruction to trigger the document generation request. Here, the related component can be a component configured by the underlying system of the terminal device, or a component configured in the related software client, and its implementation form can be flexibly set as needed. For example, in some embodiments, the component can be a component with voice interaction function, which can recognize the voice data of the target object through voice recognition technology. The target object can trigger the document generation request by voice interaction with the terminal device, such as saying "generate a document of clock-in attendance" and the like. In some embodiments, an icon button of "generate document" can be provided on the interface of the terminal device. The target object can trigger the document generation request by clicking the icon button. Of course, it can be understood that in other embodiments, the received touch, sliding and other operations of the target object on the specified screen area of the terminal device can also be taken as the instruction to trigger the document generation request, which is not limited specifically by the present application.
[0117] Of course, it needs to be pointed out that in the embodiments of the present application, the document generation request can also not be triggered through the target object and the terminal device. For example, the target object can set a specific time node or event node in advance, such as project completion, new order confirmation, or periodic report, and when the system meets the corresponding time node or event node, the document generation request can be automatically triggered, thereby realizing the automatic generation of the document to realize a more seamless workflow, and the present application does not limit this.
[0118] In step 510, the corresponding business data can be obtained in response to the document generation request of the target object, which is denoted as target business data in the embodiments of the present application. Specifically, the document generation request can be parsed to understand the context information and specific requirements of the document generation request, for example, some parameters involved in the document generation request can be parsed, such as the document type, specific data fields, or format requirements. For example, the document generation request is used to generate a sales report document, and it can be necessary to know which sales data are included in the document, such as sales, product category, region, etc. By parsing the document generation request, the data source information requested by the document generation request can be obtained. Then, the target business data corresponding to the document generation request can be collected from the related database according to the data source information obtained by parsing.
[0119] In the embodiments of the present application, the specific use mode is not limited when collecting the target business data. For example, in some embodiments, SQL (Structured Query Language) technology can be used for querying. SQL technology is a standard programming language for managing and processing relational databases. If the related business data is stored in a MySQL, SQL Server, PostgreSQL, or other database, the target business data can be obtained by using the corresponding SQL query statement. In some embodiments, the target business data can be obtained by using the API (Application Programming Interface) calling mode. API is a set of predefined functions that allow applications and databases to interact. By triggering API calling through the document generation request, the target business data can be collected from the database storing the business data. Of course, the above embodiments are only used to exemplarily describe some implementation modes of obtaining the target business data in the present application, and other data extraction technologies can also be used to obtain the target business data in actual execution, and the present application does not limit this.
[0120] In step 520, after obtaining the target business data, offline document generation can be performed according to the target business data, so as to obtain an offline document corresponding to the target business data. Specifically, in the embodiments of the present application, before performing the offline document generation on the target business data, a preprocessing operation can be performed on the target business data, which can help to clean and optimize the data, so that the data is more suitable for document generation. For example, in some embodiments, the preprocessing operation performed on the target business data can include, but is not limited to, data cleaning, data integration, data conversion, data visualization, etc. The data cleaning can be used to detect whether there are null values or missing values in the target business data, and to decide whether to delete the rows containing these values or to fill them with statistical quantities such as average, median or mode. Data integration is used to integrate data from multiple data sources together to ensure that all data is under the same reference framework, for example, the data can be merged or normalized to improve the standardization and uniformity of the data. Data conversion is used to adjust the content format of the data, such as scaling the unit of the data to the same scale, or adjusting the display format of the data to ensure that date, time, currency and other data can be normally displayed in the subsequently generated document. Data visualization can be used to generate related charts or images, such as bar charts, line charts, pie charts, etc., which can be used when generating offline documents, thereby improving the recognition and intuitiveness of the data.
[0121] In the embodiments of the present application, when generating an offline document, a related document template can be used. The document template here can be created in advance for direct use, or can be temporarily generated according to the operation of the target object. For example, the document template can be a simple text file, or an HTML, Markdown or other format file, in which the data content to be displayed is set in advance, and how to present them in the document is set. For example, if a document template corresponding to a sales report is being created, it can include title, table, chart and other document elements, and the data content can include order number, product name, sales amount, etc., which are not limited by the present application. In the document template, some placeholders or variables can be included, and when the offline document generation is performed using the target business data, the preprocessed target business data can be filled into the document template by related programming code to replace the placeholders or variables therein. After the replacement is completed, the document template combined with the target business data can be converted into an offline document in a specified format, and the format of the offline document can be flexibly set as needed, such as PDF, DOCX, HTML or Markdown, etc.
[0122] For example, refer to Figure 6 , Figure 6 An interactive schematic diagram for generating an offline document is shown in the embodiments of the present application. Figure 6In some embodiments, the document application can have several services, such as an export service that can be used to process a document generation request of a target object, and provide a feedback of the document to the target object by invoking other services; a business data service that can be used to provide a query and acquisition service of target business data. For the generation process of the offline document, the target object sends a document generation request to the export service, the export service acquires the target business data from the business data service in response to the document generation request of the target object, and then performs splicing and other processing on the target business data to generate a corresponding offline document and store it. In the embodiments of the present application, when the offline document is fed back to the target object later, the specific storage address information can be fed back to facilitate the target object to download and acquire the offline document.
[0123] In step 530, it can be detected whether the current online document service is in an available state. Here, the online document service refers to a service that provides online document generation, display, and other application services related to the online document, and can provide various objects with the functions of generating, browsing, and editing the online document through the network. Specifically, the online document service can be a part of the function unit of a certain document application software, can be an independent document application, or can be a function component dependent on other host applications, and the present application does not limit this.
[0124] When detecting whether the online document service is in an available state, there can be various ways of implementation. Exemplarily, in some embodiments, it can be attempted to open the application or browser webpage where the online document service is located, and if the application or browser webpage can be normally loaded, it can be considered that it is in an available state; in contrast, if there is a loading error or it cannot be accessed, it can be considered that the current online document service is in an unavailable state. In some embodiments, part of the online document service can be provided with an application program interface, and the state thereof can be queried through the application program interface corresponding to the online document service, so as to determine whether it is in an available state. In some embodiments, a third-party detection tool can also be used to detect the parameters related to the online document service, such as detecting the transmission of data from the terminal device to the server corresponding to the online document service, and if it is found that the data transmission is abnormal, it can be considered that the current online document service is in an unavailable state. Of course, it can be understood that the above embodiments are only used to introduce some situations of detecting whether the online document service is in an available state, and the actual implementation is not limited thereto.
[0125] In step 540, when it is detected that the current online document service is in an available state, the offline document can be converted into an online document by the online document service, and the converted online document is fed back to the target object. Specifically, in the embodiments of the present application, the offline document can be transmitted to the online document service, and after the online document service receives the offline document, the format of the offline document can be identified first, so that the content of the offline document can be decoded according to the corresponding parser, and the structure and format information such as paragraphs, fonts, tables, pictures, etc. are analyzed. Then, the online document service can use the relevant conversion engine to convert the parsed offline format content into the corresponding online format content, that is, the online document can be obtained. For example, Google Docs can parse and convert the offline document in docx format into an online document in XML format; Microsoft Office can parse and convert the offline document in docx format into an online document in OOXML or other format, in the embodiments of the present application, different online document services can use different conversion engines, and the layout of the obtained online document can be different, and the present application does not limit the specific online document service used.
[0126] After obtaining the online document, it can be stored in the related cloud database, and the corresponding URL (Uniform Resource Locator) information is recorded. The URL information can be used to identify the resource address of the online document. Generally, the URL information can include protocol, host name, port number, path, query string, fragment identifier, etc. Among them, the protocol defines how to access the resource of the online document, and the common ones are HTTP (Hypertext Transfer Protocol) and HTTPS (Hypertext Transfer Protocol Secure). The host name indicates the server where the resource of the online document is located, which is usually the domain name. The port number (which can be omitted) can be used to specify the port of a specific service. The path specifies the specific resource location on the server, the query string can be used to transmit parameters to the server, and the fragment identifier is used to locate a specific part within the same page. Illustratively, the URL information corresponding to an online document can be "https: / / www.wendang.com / path / to / page?query=string#fragment", wherein "https" is the protocol, "www.wendang.com" is the host name, " / path / to / page" is the path, "query=string" is the query string, and "fragment" is the fragment identifier. In the embodiments of the present application, the URL information corresponding to the online document can be sent to the target object, so that the target object can access the online document.
[0127] In step 550, when it is detected that the current online document service is in an unavailable state, the previously obtained offline document can be fed back to the target object, and the target object can use the offline document for browsing or editing, etc., so that the document use requirements of the target object can be met as much as possible. Moreover, it needs to be pointed out that in the embodiments of the present application, the offline document is generated in advance, and the online document is generated through online conversion on the basis of the offline document. When the online document service is abnormal, the offline document generated in advance can be fed back to the target object in time, and it is not necessary to generate and export the offline document based on the business data again, thereby facilitating the generation efficiency of the document and the use experience of the target object. Specifically, in the embodiments of the present application, the offline document fed back to the target object can be directly sent to the target object, or the storage address of the offline document can be queried, and the information of the storage address is sent to the target object, so as to facilitate the target object to download the offline document according to the information of the storage address, and the present application does not make any limitation in this regard.
[0128] Of course, it can be understood that in the embodiments of the present application, after the offline document is generated, the target object can also be directly provided with a channel to obtain the offline document, and it is not necessary to provide the offline document only in the specific case that the online document service is unavailable, and the present application does not make any limitation in this regard.
[0129] It can be understood that in the embodiments of the present application, the offline document is generated in advance, and then the online document is generated through online conversion on the basis of the offline document. When the online document service is abnormal, the offline document generated in advance can be fed back to the target object in time, and it is not necessary to generate and export the offline document based on the business data again, the time consumption of exporting is short, and it is convenient for the target object to browse and edit the related document content; the target object does not need to reinitiate a document generation request when it is found that the online document service is unavailable, the adverse effects caused by the unavailability of the online document service can be reduced, and the generation efficiency of the document and the use experience can be improved.
[0130] Specifically, in some embodiments, the method provided in the embodiments of the present application further includes:
[0131] The offline document is updated according to the editing operation of the target object, and once the online document service becomes available, the updated offline document is converted into an online document by using the online document service, and the online document is fed back to the target object.
[0132] In the embodiment of the present application, after the target object is fed back the offline document, the target object can edit the offline document, and according to the editing operation of the target object, the stored offline document can be updated. In step 550, the availability of the online document service is also continuously detected, and once the online document service becomes available, the stored updated offline document is converted into an online document by using the online document, so as to obtain an online document covering the editing content of the target object, which is fed back to the target object.
[0133] It should be noted that in the embodiment of the present application, once the online document service becomes available, the stored updated offline document is converted into an online document. Here, "once" is used to limit the condition of action execution, and does not mean that the time node of the online document service becoming available and the starting time node of converting the stored updated offline document into an online document must be the same. For example, in some scenarios, the state of the online document service can be queried every certain period of time, and when the online document service becomes available in a certain query, the stored updated offline document can be converted into an online document from the time node of obtaining the result of the query. The present application does not limit the time length between two queries.
[0134] It can be understood that in the embodiment of the present application, when the online document service becomes available, the edited updated offline document can also be converted into an online document and sent to the target object, which is beneficial to improve the information sharing efficiency and transmission immediacy.
[0135] Specifically, in some embodiments, in response to a document generation request of a target object, target business data corresponding to the document generation request is obtained, including:
[0136] The document generation request of the target object is received.
[0137] The document generation request is parsed to determine that the document generation request indicates the belonging object corresponding to the exported business data;
[0138] The identification information of the belonging object is obtained, and the target business data is collected according to the identification information;
[0139] The method provided in the embodiment of the present application further includes:
[0140] The online document is fed back to the belonging object.
[0141] In some scenarios, in the embodiment of the present application, when generating an online document, the target object can autonomously select the object to which the business data to be exported belongs. For example, the target object can be an employee of the personnel department of a company, and he needs to export the online document generated to include the punch-in and punch-out attendance data of the colleagues in a certain department in a certain month. In this case, when the document generation request is triggered, the employee of the personnel department can select which punch-in and punch-out attendance data (i.e., business data) of the colleagues to export, so as to automatically generate an online document including the punch-in and punch-out attendance data of the employees in a certain department in a certain month. In other words, the document generation request can carry the information of the object corresponding to the specified exported business data, and the object corresponding to the specified exported business data is referred to as the attribution object. In the embodiment of the present application, after receiving the document generation request of the target object, the document generation request can be parsed to determine the attribution object indicated by the document generation request to export the business data. Here, the number of attribution objects can be one, two or more, and the present application does not limit this.
[0142] It should be noted that in the embodiment of the present application, the business data indicated in the document generation request can include different types. For example, in some scenarios, it can be necessary to export punch-in type business data, and it can also be necessary to export leave type and field work type business data. In this case, different business data can correspond to the same set of attribution objects, or can correspond to different sets of attribution objects, and when corresponding to different sets of attribution objects, the sets of attribution objects can include the same attribution object, and the present application does not limit this.
[0143] After determining the attribution object, the identification information of the attribution object can be obtained. Here, the identification information can be used to identify and distinguish different objects, and the specific content and data form of the identification information are not limited by the present application. For example, in some embodiments, the identification information can include the identity information of the object, such as name, gender, age, etc. In some embodiments, the identification information can be data composed of relevant numbers or characters, such as employee number, ID number, online platform nickname, etc. For each object, the business data corresponding to them can be bound to the identification information, and therefore, in the embodiment of the present application, the business data corresponding to the identification information can be queried from the corresponding database through the identification information corresponding to the attribution object, so as to collect the target business data.
[0144] In the embodiments of the present application, since the generated document is closely related to the attribution object, the attribution object is likely to be required to participate in the browsing or editing of the online document in the future. For example, for the online document of the punch card attendance data, after the online document is generated, the relevant employee may need to browse and confirm whether his / her punch card record is correct, and perform electronic signature or confirmation operation. Therefore, in the embodiments of the present application, after the online document corresponding to the document generation request is generated, the online document can also be fed back to the attribution object, and the specific feedback manner has been described in the foregoing embodiments, which will not be repeated here.
[0145] It can be understood that, in the embodiments of the present application, the document generation request can cover the information indicating the attribution object corresponding to the exported business data, so that the target object can select the business data of which object to export in the document, and the flexibility and practicability of document generation can be improved. Moreover, after the online document is generated, the online document is fed back to the attribution object synchronously, and the generation and unified distribution of the online document can be realized without the operation of the attribution object, so that the information sharing efficiency and transmission immediacy of the document can be improved, and the efficiency of collaborative office can be improved.
[0146] Specifically, in some embodiments, the method provided in the embodiments of the present application further includes:
[0147] receiving the export configuration information input by the first object; the export configuration information includes the business name of the executable data export service and the data address and data format corresponding to the business name;
[0148] in response to the document generation request of the target object, obtaining the target business data corresponding to the document generation request, including:
[0149] receiving the document generation request of the target object, and determining the target business name of which data export service needs to be executed according to the document generation request;
[0150] determining the target data address and target data format corresponding to the target business name from the export configuration information;
[0151] obtaining the target business data corresponding to the document generation request according to the target data address and target data format.
[0152] In the embodiments of the present application, in a scenario such as enterprise office, the business needs to generate a document. If a corresponding document generation sub-application is developed for each business, the overall development cost of the application will be high, the code reusability is low, the code redundancy of the application is easy to cause, and the installation and use are not convenient. Therefore, in the embodiments of the present application, a strategy for quickly accessing the document generation function of different businesses through export configuration information is provided.
[0153] Specifically, in the embodiments of the present application, for the application of document generation, the relevant personnel can be allowed to add export configuration information. The relevant personnel is denoted as a first object. The first object can be a developer of the document generation application or a user of the document generation application, and the present application does not limit this. The document generation application can be a sub-application integrated in other office applications.
[0154] The first object can input the export configuration information, which can include the business name of the executable data export service and the data address and data format corresponding to the business name. Specifically, the business name of the executable data export service is used to identify which businesses can export related business data. For example, an enterprise office application includes a document generation function, and the enterprise office application can process various businesses, such as clock-in business, approval business, financial business, and meeting business. For these businesses, it can be decided according to needs which businesses are the types of executable data export services. For example, the clock-in business and the approval business are relatively simple in data and involve less privacy and enterprise security, and can support the execution of data export services. The financial business and the meeting business are relatively sensitive, and if the execution of data export services is supported, data leakage risks can easily occur, and therefore these businesses can be set to not executable data export services. In the embodiments of the present application, for the businesses executable for data export services, their business names can be recorded, such as the clock-in business and the approval business, and the business names can be recorded as “clock-in” and “approval”. In addition, it is inquired where the business data corresponding to these businesses is stored and what the data format is, so as to record the data address and data format corresponding to the business names. After obtaining the business names and the data address and data format corresponding to the business names, the export configuration information can be constructed in the form of key-value pairs, with the business names as keys and the data address and data format as values.
[0155] In the embodiments of the present application, referring to the foregoing embodiments, the first object can input the export configuration information into the enterprise office application. If the business name configured in the export configuration information is “clock-in”, the enterprise office application can subsequently use the data address and data format corresponding to the business name “clock-in” in the export configuration information to obtain the target business data and generate an online document related to clock-in. Of course, it can be understood that the business name configured by the export configuration information in the embodiments of the present application can be one or more. In addition, the first object can flexibly input the export configuration information in batches or delete the previously input export configuration information according to actual needs, so as to realize the application of different businesses to quickly access the document generation function.
[0156] When the first object configures the export configuration information, in subsequent data generation according to the document generation request, the target business data can be obtained. The business name of the data export service that needs to be executed can be determined according to the document generation request, and is recorded as the target business name. For example, according to the document generation request, it is determined that the business name corresponding to the business data that the target object needs to export is "approval", and the target business name is "approval". After the target business name is determined, the data address and the data format corresponding to the target business name can be determined from the export configuration information, and are recorded as the target data address and the target data format respectively. Then, the target business data corresponding to the document generation request can be obtained according to the target data address and the target data format.
[0157] It can be understood that, in the embodiments of the present application, the export configuration information can be used to flexibly configure the types of businesses that support document generation, which is beneficial to meet the different needs of application users, and different application functions do not need to be developed for different business types, which can significantly improve the code reusability.
[0158] Specifically, in some embodiments, the target business data corresponding to the document generation request is obtained according to the target data address and the target data format, including:
[0159] obtaining the original business data according to the target data address;
[0160] parsing the target data format to determine the target field name and the target field type specified in the export configuration information;
[0161] searching for field content matching the target field name and the target field type in the original business data to obtain the target business data.
[0162] In the embodiments of the present application, the data address configured by the first object can be used to specify where the business data corresponding to the business name is stored; the data format can further include a field name and a field type, wherein the field name and the field type can be used to specify which field content is the actual required business data under the corresponding business name. It should be noted that, here, the field name and the field type can include multiple groups, and each field name corresponds to a field type. When the field content of the business data is consistent with the field name, and the field type is also consistent, it means that the field content is the target business data that needs to be exported.
[0163] For example, for the "clock-in" type of business name, the field name included in the data format can be set as "name", "department" and "clock-in time"; wherein the field type corresponding to the field name "name" is a string, the field type corresponding to the field name "department" is a string, and the field type corresponding to the field name "clock-in time" is an integer.
[0164] In the embodiment of the present application, when the target business data corresponding to the document generation request is obtained according to the target data address and the target data format, all business data corresponding to the target business name can be obtained according to the target data address first, and the all business data is recorded as original business data. It can be understood that the original business data may contain some field contents irrelevant to the actual business name, therefore, in the embodiment of the present application, the original business data can be filtered by the target data format. Specifically, the target data format can be parsed to determine the field name and the field type specified by the export configuration information, and the field name and the field type are recorded as the target field name and the target field type respectively. Then, the field contents matching the target field name and the target field type in the original business data can be searched, and the field contents are determined as the target business data.
[0165] It can be understood that, in the embodiment of the present application, the original business data is obtained through the target data address, and the original business data is filtered by the target field name and the target field type, so that only the field contents matching the combination of the target field name and the target field type can be collected as the target business data. In this way, the probability of irrelevant data existing in the target business data can be reduced, and the quality of the subsequently generated document can be improved.
[0166] Specifically, in some embodiments, searching the field contents matching the target field name and the target field type in the original business data includes:
[0167] constructing a matching tree model based on an automaton according to the target field name;
[0168] inputting characters in the original business data into the matching tree model to detect whether there is a character combination matching the target field name in the original business data;
[0169] if there is a character combination matching the target field name in the original business data, obtaining a field value corresponding to the character combination;
[0170] if the type of the field value is the target field type, the character combination and the field value are determined as the field contents matching the target field name and the target field type.
[0171] In the embodiment of the present application, when the matching field contents are determined by the target field name and the target field type, the strategy of automaton search can be adopted.
[0172] Specifically, in the embodiments of the present application, a matching tree model based on an automaton can be constructed. Here, an AC automaton (Aho-Corasick automaton) can be selected to build the matching tree model. The matching tree model based on the AC automaton is a high-efficiency string matching algorithm, which utilizes the ideas of a dictionary tree (Trie tree) and a finite state automaton, and constructs multiple pattern strings into a matching tree, so as to realize high-efficiency matching of the multiple pattern strings in a text.
[0173] In the construction process of the matching tree model, first, all target field names can be constructed into a dictionary tree, where the dictionary tree is a tree containing multiple nodes, each node represents a character in a target field name, and a path from a root node to a leaf node is a pattern string (target field name); then, the dictionary tree can be transformed, and all non-root nodes are marked as ordinary nodes, repeated nodes or end nodes, where the repeated node indicates that the node appears multiple times in a pattern string, and the end node indicates that the node is an end node of a pattern string. Next, the transformed dictionary tree is constructed into a finite state automaton (FSM), i.e., an AC automaton, and the construction process mainly includes state transition and failure pointer construction. The state transition refers to jumping to the next state according to the current matching character and the current state in the process of matching a text string; the failure pointer refers to jumping to a new state to continue matching when the current state cannot be matched.
[0174] When the matching tree model is constructed, the matching of the text string can be performed on the automaton. For the embodiments of the present application, the text string to be matched, i.e., the original business data, can be input into the matching tree model in sequence, one character is matched each time, and the jumping on the automaton is determined according to the current state and the matching character, so as to determine the target character combination identical to the pattern string (i.e., the target field name), until the entire original business data is scanned. If the matching tree model search finds a character combination matching the target field name, the field value corresponding to the character combination can be obtained, if the type of the field value is the target field type, then it is indicated that the character combination and the corresponding field value belong to the field content matching the target field name and the target field type. If the type of the field value is not the target field type, then the matching of the next character combination can be continued.
[0175] In the embodiments of the present application, through the matching tree model of the automaton, the field matching the target field name can be efficiently determined, and the type of the corresponding field value is matched, so as to quickly and accurately determine the field content matching the target field name and the target field type, and facilitate the acquisition of the target business data.
[0176] Specifically, in some embodiments, the export configuration information further includes a document style corresponding to the business name; and the target business data is used to generate an offline document, including:
[0177] a target document style corresponding to the target business name is determined from the export configuration information;
[0178] the target business data is adjusted according to the target document style;
[0179] the adjusted target business data is spliced to obtain an offline document corresponding to the target business data.
[0180] In the embodiments of the present application, in the export configuration information, the first object can also configure a document style corresponding to the business name. The document style can specify what kind of offline document to generate. For example, the document style can specify the font color, font boldness, cell length and width, etc. in the offline document, which is not limited in the present application. It can be understood that for different business names, the corresponding document styles can be the same or different.
[0181] In the embodiments of the present application, when generating an offline document according to target business data, as described above, the document generation request can be parsed first to determine the target business name indicated by the request that needs to perform data export service. Then, the document style corresponding to the target business name can be determined according to the export configuration information pre-configured by the first object, which is denoted as a target document style. Subsequently, the target business data can be adjusted according to the target document style, and the adjusted target business data can be spliced to obtain an offline document corresponding to the target business data.
[0182] It can be understood that in the embodiments of the present application, the first object supports configuring a document style corresponding to the business name through export configuration information. In this way, it is convenient to generate offline documents with uniform format, and when converting online through offline documents, it can reduce conversion errors and garbled codes caused by non-uniform formats, and improve the stability and reliability of document generation.
[0183] In the foregoing description of step 530, it is introduced that the implementation manner of first detecting whether the online document service is in an available state, and then selecting whether to perform the online conversion task (i.e. the task of converting the offline document into an online document by using the online document service). In fact, there can be a case that although the current online document service is in an available state, an exception occurs in the process of online conversion, which leads to the failure to normally complete the online conversion task. Therefore, in another implementation manner, the detection of whether the online document service is in an available state and the execution of the online conversion task can be integrated together, and the detection of whether the online document service is in an available state can be performed in the process of task execution.
[0184] Specifically, in some embodiments, detecting whether the current online document service is in an available state comprises:
[0185] By online converting the offline document through the online document service, recording a starting time node of a task of starting to perform the online conversion;
[0186] Detecting whether the task of online conversion generates an online document;
[0187] If a time length from the current time node to the starting time node exceeds a first threshold, and the task of online conversion does not generate the online document, determining that the current online document service is in an unavailable state.
[0188] In the embodiments of the present application, after obtaining the offline document, the offline document can be directly sent to the online document service, the offline document is online converted through the online document service, and a time node of starting to perform the online conversion is recorded, which is recorded as a starting time node. Then, it can be detected whether the task of online conversion generates an online document. It can be understood that if the online document service is in an available state and there is no any exception, the task of online conversion can be processed and completed within a reasonable time; relatively, if the online document service has an exception and is in an unavailable state, there can be a situation that the online document cannot be normally generated for a long time. Therefore, in the embodiments of the present application, a time threshold can be set in advance, which is recorded as a first threshold, the time length from the current time node to the starting time node can be calculated in real time, if the first threshold is not reached and the online document is not generated, it is indicated that the online document service can continue to convert, and it can continue to be determined; if the first threshold is not reached but the online document is generated, it is indicated that the online document service is in an available state, and the task of converting the offline document into the online document by the online document service is completed, the online document can be fed back to the target object. If the first threshold is reached and the online document is not generated, it is indicated that the online document service can have an exception, at this time, it can be determined that the online document service is in an unavailable state, and the subsequent step 550 can be performed.
[0189] It should be noted that, in the embodiments of the present application, the length of the first threshold value can be flexibly set according to actual needs. In some embodiments, the file size of the offline document or the data volume of the target business data that needs to be converted can also be detected, and the first threshold value can be determined according to the file size of the offline document or the data volume of the target business data. For example, the larger the file size of the offline document or the data volume of the target business data, the larger the first threshold value can be; the smaller the file size of the offline document or the data volume of the target business data, the smaller the first threshold value can be, that is, the first threshold value can be positively correlated with the file size of the offline document or the data volume of the target business data. For the specific functional relationship, it can be determined according to actual needs or past experience values, and the present application does not limit this.
[0190] It can be understood that, in the embodiments of the present application, the offline document can be directly handed over to the online document service for online conversion, and whether the online document service is abnormal can be judged by the length of time of online conversion. In this way, even if an abnormality occurs in the process of online conversion, it can also be accurately and timely discovered, thereby facilitating the feedback of the offline document to the target object, minimizing the adverse effects of the unavailability of the online document service, and improving the document editing efficiency and use experience of the target object.
[0191] Specifically, in some embodiments, detecting whether the online conversion task generates the online document comprises:
[0192] detecting a historical time node of the last time when the inquiry signal is sent; wherein the inquiry signal is used to inquire whether the online conversion task generates the online document;
[0193] If the inquiry signal sent last time indicates that the online conversion task does not generate the online document, and the length of time from the current time node to the historical time node reaches the second threshold value, the inquiry signal is re-sent, and the step of detecting the historical time node of the last time when the inquiry signal is sent is returned.
[0194] In the embodiments of the present application, when detecting whether the online conversion task generates the online document, a polling method can be used to achieve it. Specifically, in the embodiments of the present application, a polling time period can be set, which is denoted as the second threshold value. For example, the second threshold value can be one minute, five minutes or other lengths, and the present application does not limit this. In the polling process, an inquiry signal can be sent every second threshold value time period, which is used to inquire whether the online conversion task generates the online document, and the corresponding inquiry result is returned.
[0195] In actual execution, a time node of last sending of the inquiry signal can be detected, denoted as a historical time node. Then a result of the last sent inquiry signal is queried. If the inquiry signal indicates that the online conversion task does not generate the online document, and a time length from the current time node to the historical time node reaches a second threshold, a new inquiry signal can be re-sent. Such a cycle execution can achieve polling confirmation of whether the online conversion task generates the online document, facilitating timely feedback of the online document to the target object when the online document is generated, and improving the feedback efficiency of the online document.
[0196] Specifically, in some embodiments, if the current online document service is in an available state, converting the offline document into the online document by using the online document service includes:
[0197] If the current online document service is in an available state, a first asynchronous task is generated; the first asynchronous task is used for converting the offline document into the online document;
[0198] The first asynchronous task is executed, and a first task identification of the first asynchronous task is returned;
[0199] The completion state of the first asynchronous task is periodically polled by the online document service according to the first task identification, and the online document is obtained.
[0200] In the embodiments of the present application, in the specific execution of the online conversion task of the offline document, an asynchronous processing manner can be used for implementation. Specifically, in the embodiments of the present application, in the execution of the online conversion task, if the current online document service is in an available state, an asynchronous task can be generated, denoted as a first asynchronous task. The first asynchronous task can be used for converting the offline document into the online document. And, at the same time of generating the first asynchronous task, a task identification can also be generated, denoted as a first task identification. The first task identification can be used for uniquely identifying and distinguishing each first asynchronous task. For example, the first task identification can include characters or numbers, and the present application does not make any limitation. After obtaining the first task identification, the online document service can periodically poll the completion state of the first asynchronous task according to the first task identification. The specific implementation process is similar to the foregoing polling embodiment, and will not be repeated here. After the first asynchronous task is completed, the converted online document can be obtained.
[0201] For example, refer to Figure 7 , Figure 7 An interactive schematic diagram of the asynchronous processing of the online conversion task of the offline document is shown. Figure 7In some embodiments, the online document service can send the storage address of the offline document to the first asynchronous task, so that the first asynchronous task downloads the offline document and converts it online. The first asynchronous task can update the task status in real time and timely feedback the generated online document after the task is completed.
[0202] It can be understood that, in the embodiments of the present application, the online conversion task of the offline document is processed by using the asynchronous processing mode, which can free the process of the online document service and does not affect the use of other functions of the online document service by the target object. For example, when the online conversion task in the document generation task is processed by the online document service, the target object can still normally use the online document service to browse other online documents. In this way, the availability of the online document service can be improved, the target object can conveniently process other work contents in time, and the use experience of the online document service is improved.
[0203] Specifically, in some embodiments, the method provided in the embodiments of the present application further includes:
[0204] In response to the document generation request of the target object, a second asynchronous task is generated; the second asynchronous task is used to execute the document generation task corresponding to the document generation request;
[0205] feedback prompt information to the target object; the prompt information is used to inform the target object of a target channel for receiving the online document or the offline document;
[0206] The second asynchronous task is executed, and the online document or the offline document is fed back to the target object through the target channel.
[0207] In the embodiments of the present application, the entire document generation task can also be processed asynchronously. Please refer to Figure 8 and Figure 9 , Figure 8 Fig. 1 shows an interaction schematic diagram of processing a document generation task asynchronously according to an embodiment of the present application, Figure 9An interaction schematic diagram of asynchronously processing a document generation task by exporting configuration information is shown in the embodiments of the present application. In the embodiments of the present application, after the target object initiates a document generation request, an asynchronous task can be generated, which is recorded as a second asynchronous task. The second asynchronous task can be used to execute a document generation task corresponding to the document generation request, that is, the process of obtaining target business data corresponding to the document generation request and steps 520 to 550 can be executed to obtain a corresponding offline document or an offline document and an online document. At the same time of generating the second asynchronous task, a prompt information can be fed back to the target object, which can inform the target object of a target channel for receiving the online document or the offline document. After obtaining the online document, the online document can be fed back to the target object through the target channel; if the offline document needs to be fed back, the target channel can also be used for feedback. For example, in a certain office application, there can be multiple sub-function modules, such as “clock-in”, “approval” and the like. In the embodiments of the present application, which sub-function module is used as the target channel for feedback can be determined based on the business name. For example, for a document generation request with a target business name of “clock-in”, the function module of “clock-in” can be used as the target channel for feeding back the document, that is, the target object can enter the function module of “clock-in” to obtain the generated document. In some embodiments, the target channel can also be configured by the first object through the export configuration information, which is not limited in the present application.
[0208] It should be noted that in the embodiments of the present application, at the same time of generating the second asynchronous task, a task identifier can also be generated, which is recorded as a second task identifier. The second task identifier can be used to uniquely identify and distinguish each second asynchronous task. For example, the second task identifier can include characters or numbers, which is not limited in the present application. After obtaining the second task identifier, the target object can be fed back, which is convenient for the target object to view the specific task progress according to the needs.
[0209] It can be understood that in the embodiments of the present application, the entire document generation task is asynchronously processed, and the target object does not need to wait for the completion of the document generation task in the front end of the application, and can normally use the document application to process other work flows. After generating the related document, the target object can be fed back in time through the corresponding target channel. In this way, the entire document generation task can be completed with low perception, and the target object only needs to initiate a document generation request and wait for the feedback of the file in the target channel after seeing the prompt information, the operation process is simple, and the use experience of the document application is better.
[0210] Specifically, in some embodiments, once the online document service becomes available, the online document service is used to convert the updated offline document into an online document, and the online document is fed back to the target object, including:
[0211] obtaining a state parameter of the online document service;
[0212] predicting a failure recovery time of the online document service based on the state parameter through a prediction model;
[0213] polling a state of the online document service according to the failure recovery time, so as to convert the updated offline document into an online document through the online document service and feed back the online document to the target object when it is determined that the online document service becomes available.
[0214] In the embodiments of the present application, if it is found that the online document service is in an unavailable state, a state parameter of the online document service can be obtained. For example, the running state of the online document service can be obtained through system logs, detection tools or application program interfaces of the online document service. These parameters can include but are not limited to: server load, memory usage, CPU utilization, network bandwidth, response time, error rate, system stability index, etc. These data can be obtained once every period of time to form a historical data set. Then, if the current online document service is in an unavailable state, the failure recovery time of the online document service can be predicted based on the state parameter obtained last time (or multiple times) through a prediction model. Here, the prediction model can be an artificial intelligence model established according to a machine learning algorithm, for example, it can be a linear regression model, a decision tree model, a random forest model, a support vector machine, a neural network model or a time series model, etc., which is not limited in the present application.
[0215] Through the prediction model, the failure recovery time of the online document service can be predicted based on the state parameter, that is, when the online document service is most likely to recover to an available state. According to the failure recovery time of the online document service, a suitable polling time can be easily determined. For example, if the predicted failure recovery time is twenty minutes, that is, the online document service is most likely to recover to an available state in twenty minutes, in the embodiments of the present application, a starting time node that is not polled before reaching the failure recovery time can be selected, for example, polling can be started after eighteen minutes, and polling can be performed every 10 seconds to determine the state of the online document service. In this way, the time when the online document service becomes available can be quickly determined, so as to facilitate timely conversion of the updated offline document into an online document through the online document service and feedback to the target object.
[0216] It should be noted that before being used, the prediction model generally needs to be trained. In the embodiments of the present application, the state parameters corresponding to the failure of the online document service before the online document service appears failure and the failure recovery time can be acquired in advance, the state parameters are used as training input data, the failure recovery time is used as a label, the prediction model is trained, and the parameters of the model are adjusted to optimize the performance. The specific implementation process can be implemented by referring to the prior art in the related field, and the present application will not repeat it.
[0217] It can be understood that in the embodiments of the present application, the failure recovery time of the online document service is predicted by the prediction model, and the state of the online document service is polled according to the failure recovery time, so that the number of polling can be reduced and the efficiency of polling can be improved; at the same time, the time node at which the online document service becomes available can be determined as quickly as possible, which is beneficial to generating the online document in time and improving the document use experience of the target object.
[0218] Specifically, in some embodiments, the number of online document services includes a plurality of;
[0219] The method provided in the embodiments of the present application further includes:
[0220] querying the historical use record of the target object on the online document service;
[0221] determining the target online document service from the plurality of online document services according to the historical use record;
[0222] if the current online document service is in an available state, converting the offline document into an online document by using the online document service, including: if the current target online document service is in an available state, converting the offline document into an online document by using the target online document service;
[0223] if the current online document service is in an unavailable state, feeding back the offline document to the target object, updating the offline document according to the editing operation of the target object, and once the online document service becomes available, converting the updated offline document into an online document by using the online document service and feeding back the online document to the target object, including:
[0224] If the current target online document service is in an unavailable state, the target object is fed back an offline document, the offline document is updated according to an editing operation of the target object, once the target online document service becomes available within a predetermined time length, the updated offline document is converted into an online document by using the target online document service, and the target object is fed back the online document; if the target online document service is in an unavailable state within the predetermined time length, the states of other online document services are detected, once any one of the other online document services is in an available state, the updated offline document is converted into an online document by using the other online document service, and the target object is fed back the online document; wherein the other online document service is an online document service other than the target online document service.
[0225] In some scenarios in the embodiments of the present application, multiple online document services can be provided in an application, and the corresponding service providers of each online document service can be different. In this case, which online document service is used to process the document generation task can be determined based on the usage habits of the target object, and when some online document services are unavailable, the generation of online documents can be performed in time by using alternative online document services.
[0226] Specifically, in the embodiments of the present application, the historical usage records of the target object on the online document services can be queried, and the historical usage records can include data such as the frequency or time length of using each online document service. According to the historical usage records, the online document service most frequently used by the target object can be determined, for example, the online document service with the highest frequency of use, or the online document service with the longest time length of use, which is not limited in the present application. The online document service most frequently used by the target object is determined as the target online document service, and the online document services other than the target online document service are referred to as other online document services. In subsequent execution of the document generation task, the target online document service can be given priority.
[0227] For example, for a certain document generation request, if the target online document service is currently in an available state, the offline document can be converted into an online document by using the target online document service. If the target online document service is currently in an unavailable state, the target object can be fed back an offline document, and the stored offline document is updated according to the editing operation. The state of the target online document service is polled within a predetermined time length, once it is found to be available, the updated offline document can be converted into an online document by using the target online document service, and the target object is fed back the online document. If the target online document service is in an unavailable state within the predetermined time length, other online document services can be used for conversion processing. For example, the states of the other online document services are detected, once any one of the other online document services is in an available state, the updated offline document is converted into an online document by using the other online document service, and the target object is fed back the online document.
[0228] It can be understood that, in the embodiments of the present application, the target online document service suitable for the target object can be determined from a plurality of online document services according to the use habit of the target object to process the document generation request. In addition, in the case that the target online document service is unavailable for a long time, the online document is generated in time through other online document services, the adverse effects caused by the unavailability of the target online document service are reduced, and the generation efficiency of the document and the use experience are improved.
[0229] With reference to Figure 10 The embodiments of the present application also provide a document generation system, which comprises:
[0230] The acquisition unit 1010 is configured to acquire target business data corresponding to the document generation request in response to the document generation request of the target object.
[0231] The generation unit 1020 is configured to generate an offline document corresponding to the target business data according to the target business data.
[0232] The detection unit 1030 is configured to detect whether the current online document service is in an available state.
[0233] The conversion unit 1040 is configured to convert the offline document into an online document by using the online document service and feed back the online document to the target object if the current online document service is in the available state.
[0234] The processing unit 1050 is configured to feed back the offline document to the target object if the current online document service is in an unavailable state.
[0235] Optionally, the acquisition unit is specifically configured to:
[0236] receive the document generation request of the target object.
[0237] analyze the document generation request to determine the belonging object corresponding to the exported business data indicated by the document generation request.
[0238] acquire the identification information of the belonging object, and collect the target business data according to the identification information.
[0239] The processing unit is further configured to:
[0240] feed back the online document to the belonging object.
[0241] Optionally, the system further comprises a configuration unit, and the configuration unit is specifically configured to:
[0242] receive the export configuration information input by the first object; the export configuration information comprises a business name of an executable data export service and a data address and a data format corresponding to the business name.
[0243] The acquisition unit is specifically configured to:
[0244] receive a document generation request of a target object, and determine a target service name requiring data export service according to the document generation request;
[0245] determine a target data address and a target data format corresponding to the target service name from the export configuration information;
[0246] acquire target service data corresponding to the document generation request according to the target data address and the target data format.
[0247] Optionally, the acquisition unit is specifically configured to:
[0248] acquire original service data according to the target data address;
[0249] analyze the target data format to determine a target field name and a target field type specified by the export configuration information;
[0250] search for field content matching the target field name and the target field type in the original service data to obtain the target service data.
[0251] Optionally, the acquisition unit is specifically configured to:
[0252] construct a matching tree model based on an automatic machine according to the target field name;
[0253] input characters in the original service data into the matching tree model to detect whether there is a character combination matching the target field name in the original service data;
[0254] if there is a character combination matching the target field name in the original service data, acquire a field value corresponding to the character combination;
[0255] if the type of the field value is the target field type, determine the character combination and the field value as field content matching the target field name and the target field type.
[0256] Optionally, the detection unit is specifically configured to:
[0257] perform online conversion on the offline document through the online document service, and record a starting time node of a task of starting to perform the online conversion;
[0258] detect whether the task of the online conversion generates an online document;
[0259] if a time length from the current time node to the starting time node exceeds a first threshold value, and the task of the online conversion does not generate the online document, determine that the current online document service is in an unusable state.
[0260] Optionally, the detection unit is specifically configured to:
[0261] detect a historical time node of a last time when the inquiry signal is sent; wherein the inquiry signal is used to inquire whether the online conversion task generates the online document;
[0262] If the inquiry signal sent last time indicates that the online conversion task does not generate the online document, and the time length from the current time node to the historical time node reaches a second threshold, the inquiry signal is re-sent, and the step of detecting the historical time node of the last time when the inquiry signal is sent is returned.
[0263] Optionally, the conversion unit is specifically used for:
[0264] If the current online document service is in an available state, a first asynchronous task is generated; the first asynchronous task is used to convert the offline document into the online document;
[0265] The first asynchronous task is executed, and a first task identifier of the first asynchronous task is returned;
[0266] The completion state of the first asynchronous task is periodically polled according to the first task identifier through the online document service, and the online document is obtained.
[0267] Optionally, the system further comprises an execution unit, and the execution unit is specifically used for:
[0268] In response to a document generation request of a target object, a second asynchronous task is generated; the second asynchronous task is used to execute a document generation task corresponding to the document generation request;
[0269] Feedback prompt information is fed back to the target object; wherein the prompt information is used to inform the target object of a target channel for receiving the online document or the offline document;
[0270] The second asynchronous task is executed, and the online document or the offline document is fed back to the target object through the target channel.
[0271] Optionally, the processing unit is further used for:
[0272] The offline document is updated according to the editing operation of the target object, and once the online document service becomes available, the updated offline document is converted into the online document by using the online document service, and the online document is fed back to the target object.
[0273] Optionally, the processing unit is specifically used for:
[0274] A state parameter of the online document service is obtained;
[0275] Based on the state parameter, a failure recovery time of the online document service is predicted through a prediction model;
[0276] According to the fault recovery time, the state of the online document service is polled to convert the updated offline document into an online document by using the online document service and feed back the online document to the target object when it is determined that the online document service becomes available.
[0277] Optionally, the number of online document services includes a plurality of online document services.
[0278] The system further includes a query unit, which is specifically configured to:
[0279] Query the historical use record of the target object on the online document service.
[0280] According to the historical use record, determine the target online document service from the plurality of online document services.
[0281] The processing unit is specifically configured to:
[0282] If the current target online document service is in an available state, convert the offline document into an online document by using the target online document service.
[0283] If the current target online document service is in an unavailable state, feed back the offline document to the target object, update the offline document according to the editing operation of the target object, convert the updated offline document into an online document by using the target online document service and feed back the online document to the target object once the target online document service becomes available within a predetermined time length, and detect the state of other online document services if the target online document service is in an unavailable state within the predetermined time length, convert the updated offline document into an online document by using the other online document service and feed back the online document to the target object once any one of the other online document services is in an available state, wherein the other online document service is an online document service other than the target online document service.
[0284] It can be understood that the contents in the document generation method embodiment shown in Figure 5 are all applicable to the electronic device embodiment, the electronic device embodiment specifically implements the same functions as the document generation method embodiment shown in Figure 5 , and achieves the same beneficial effects as the document generation method embodiment shown in Figure 5 .
[0285] The electronic device embodiment is further disclosed in the application, which includes:
[0286] At least one processor;
[0287] At least one memory for storing at least one program;
[0288] When the at least one program is executed by the at least one processor, the at least one processor implements the functions as described above.Figure 5 the document generation method embodiment shown.
[0289] It can be understood that the content in the document generation method embodiment shown is applicable to the electronic device embodiment, the function specifically implemented by the electronic device embodiment is the same as the function of the document generation method embodiment shown, and the beneficial effects achieved are also the same as the beneficial effects achieved by the document generation method embodiment shown. Figure 5 Figure 5 Figure 5
[0290] The electronic device of the embodiment of the present application can be a terminal device, a computer device, or a server device.
[0291] Exemplarily, refer to Figure 11 , Figure 11 for a structural schematic diagram of an electronic device provided in the embodiment of the present application. Taking the electronic device as a terminal device, Figure 11 in the embodiment, the electronic device 1100 can include RF (Radio Frequency, radio frequency) circuit 1110, memory 1120 including one or more computer readable storage media, input unit 1130, display unit 1140, sensor 1150, audio circuit 1160, short distance wireless transmission module 1170, processor 1180 including one or more processing cores, and power supply 1190, etc. Those skilled in the art can understand that Figure 11 the device structure shown in the embodiment does not constitute a limitation on the terminal device, and can include more or less components than the diagram, or combine certain components, or different component arrangements.
[0292] The RF circuit 1110 can be used for receiving and transmitting signals in information or communication processes. In particular, after receiving downlink information from a base station, the RF circuit 1110 delivers the information to the one or more processors 1180 for processing. In addition, the RF circuit 1110 transmits uplink data to the base station. Generally, the RF circuit 1110 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, etc. In addition, the RF circuit 1110 can communicate with a network and other devices by wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communication), GPRS (General Packet Radio Service), CDMA (Code Division Multiple Access), WCDMA (Wideband Code Division Multiple Access), LTE (Long Term Evolution), Bluetooth, WLAN (Wireless Local Area Network), or Wi-Fi, Zigbee, etc.
[0293] The memory 1120 can be used to store software programs and modules (or units). The processor 1180 performs various functions and data processing by running the software programs and modules (or units) stored in the memory 1120. The memory 1120 can mainly include a program storage area and a data storage area. The program storage area can store operating systems, application programs (such as sound play functions, image play functions) required by at least one function, etc. The data storage area can store data (such as audio data, phone books) created according to the use of the electronic device 1100, etc. In addition, the memory 1120 can include a high-speed random access memory, and can further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state memory device. Accordingly, the memory 1120 can further include a memory controller to provide access to the memory 1120 for the processor 1180 and the input unit 1130. Although Figure 11 The RF circuit 1110 is shown, but it can be understood that it does not belong to the essential components of the electronic device 1100, and can be omitted as needed without changing the essence of the application.
[0294] The input unit 1130 can be used to receive inputted digital or character information, and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to object setting and function control. Specifically, the input unit 1130 can include a touch-sensitive surface 1131 and other input devices 1132. The touch-sensitive surface 1131, also known as a touch display or touchpad, can collect touch operations (such as operations of an object using a finger, a stylus, or any suitable object or accessory near or on the touch-sensitive surface 1131) of the object thereon or thereabout, and drive corresponding connection devices according to pre-set programs. Optionally, the touch-sensitive surface 1131 can include two parts of a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the object and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, and converts it into touch coordinates and sends it to the processor 1180, and can receive instructions from the processor 1180 and execute them. In addition, the touch-sensitive surface 1131 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 1131, the input unit 1130 can also include other input devices 1132. Specifically, the other input devices 1132 can include one or more of a physical keyboard, function keys (such as volume control keys, on-off keys, etc.), trackballs, mice, joysticks, etc.
[0295] The display unit 1140 can be used to display information input by the object or information provided to the object, and to control various graphical object interfaces of the electronic device 1100, which can be composed of graphics, text, icons, video, and any combination thereof. The display unit 1140 can include a display panel 1141, which can be configured in the form of an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 1131 can be overlaid on the display panel 1141, and when the touch-sensitive surface 1131 detects a touch operation thereon or thereabout, it transmits to the processor 1180 to determine the type of touch event, and then the processor 1180 provides corresponding visual output on the display panel 1141 according to the type of touch event. Although in the Figure 11 , the touch-sensitive surface 1131 and the display panel 1141 are implemented as two independent components to realize input and output functions, in some embodiments, the touch-sensitive surface 1131 and the display panel 1141 can be integrated to realize input and output functions.
[0296] The electronic device 1100 can also include at least one sensor 1150, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor can include an ambient light sensor that can adjust the brightness of the display panel 1141 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1141 or the backlight when the electronic device 1100 is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and when at rest, the gravity acceleration sensor can detect the magnitude and direction of gravity, and can be used for identifying the posture of the mobile phone (such as switching between horizontal and vertical screens, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometers, taps), and the like. As for other sensors that can also be configured in the electronic device 1100, such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, and the like, they will not be described here.
[0297] The audio circuit 1160, the speaker 1161, and the microphone 1162 can provide an audio interface between the object and the electronic device 1100. The audio circuit 1160 can convert the received audio data into an electrical signal, transmit the electrical signal to the speaker 1161, and convert the electrical signal into a sound signal output by the speaker 1161. On the other hand, the microphone 1162 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1160 and converted into audio data. The audio data is processed by the processor 1180, transmitted to another electronic device via the RF circuit 1110, or output to the memory 1120 for further processing. The audio circuit 1160 can also include a jack for providing communication between an external earphone and the electronic device 1100.
[0298] The short-range wireless transmission module 1170 can be a WIFI (wireless fidelity) module, a Bluetooth module, or an infrared module, etc. The electronic device 1100 can transmit information with the wireless transmission module provided on other devices through the short-range wireless transmission module 1170.
[0299] The processor 1180 is the control center of the electronic device 1100, which connects various parts of the entire device through various interfaces and lines, executes various functions of the electronic device 1100 and processes data by running or executing software programs or modules stored in the memory 1120, and calling data stored in the memory 1120, thereby overall controlling the device. Optionally, the processor 1180 can include one or more processing cores; optionally, the processor 1180 can integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, the object interface, and the application program, and the modem processor mainly processes wireless communication. It can be understood that the above-mentioned modem processor can also not be integrated into the processor 1180.
[0300] The electronic device 1100 also includes a power supply 1190, such as a battery, for powering various components of the electronic device 1100. The power supply 1190 can also be or include one or more AC or DC current sources, a recharging system, a power failure detection circuit, a power converter or inverter, a power state
[0301] Although not shown, the electronic device 1100 can also include a camera, a Bluetooth module, and the like, which will not be described herein.
[0302] The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in
[0303] It can be understood that the contents in the document generation method embodiments as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in
[0304] The embodiments of the present application further disclose a computer program product or a computer program, the computer program product or the computer program comprising computer instructions stored in the computer readable storage medium as described above. Figure 11 The processor of the electronic device as shown in can read the computer instructions from the computer readable storage medium as described above, and the processor executes the computer instructions, so that the computer device executes the document generation method embodiments as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in
[0305] It can be understood that the contents in the document generation method embodiments as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in Figure 5 The embodiments of the present application further disclose a computer readable storage medium, wherein a program executable by a processor is stored, and the program executable by the processor is used for realizing the document generation method as shown in
[0306] In alternative embodiments, the functions / operations in the flow diagrams can occur in different orders and / or concurrently with each other. For example, two operations shown in succession can in fact be executed substantially concurrently or the operations sometimes can be executed in reverse order, depending upon the functionality / operations involved. Also, the embodiments presented and described in the flowcharts are only examples. A person skilled in the art can make alterations, modifications or equivalents to the operations and logics described in the flowcharts without departing from the scope of the present application. It should be noted that the embodiments of the present application can be implemented in many different embodiments of software, firmware, and / or hardware configurations, either alone or in any combination.
[0307] Furthermore, although the present application is described in the context of functional modules, it is understood that one or more of the functions and / or features can be integrated in a single physical device and / or software module, or one or more functions and / or features can be implemented in separate physical devices or software modules. It is also understood that a detailed discussion of the actual implementation of each module is unnecessary to an understanding of the present application. Rather, the actual implementation is within the routine of an engineer's knowledge given the property, functionality and internal relationships of the various functional modules disclosed herein. Accordingly, the present application is not limited to the implementations illustrated herein but is intended to be limited only by the claims attached hereto and by the full breadth permitted by law. It is further understood that the specific concepts presented herein are illustrative only and not intended to limit the scope of the present application, which is defined fully by the appended claims and their equivalents.
[0308] If the functions are implemented in software, the functions can be stored in or implemented as one or more software modules on a computer readable medium such as computer storage media. Based on the understanding thus permitting, the technical solutions of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk, and various media that can store program codes.
[0309] The logic and / or steps represented in the flow diagrams or otherwise described herein, for example, can be considered as a sequence of executable instructions, and can be embodied in any computer-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor- containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For purposes of this specification, a "computer-readable storage medium" can be any apparatus that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. The computer-readable storage medium can be, for example, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device.
[0310] It should be understood that aspects of the application can be implemented in hardware, software, firmware or combinations thereof. In the above embodiments, various steps or methods can be implemented in software or firmware that is stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any of the following technologies, or combinations thereof, can be used: a discrete logic circuit having logic gates for implementing logic functions upon data signals, an application specific integrated circuit having appropriate combinational logic gates, a programmable gate array (PGA), a field programmable gate array (FPGA), and / or the like.
[0311] In the above description of the present specification, reference to the description of the terms "one embodiment", "another embodiment", or "certain embodiments" or the like means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present specification. The illustrative representations of the above terms in the present specification do not necessarily refer to the same embodiment or example. Also, the described particular features, structures, materials, or characteristics can be combined in any appropriate manner in one or more embodiments or examples.
[0312] Although embodiments of the present application have been shown and described, it would be recognized by those of ordinary skill in the art that various changes, modifications, alternatives, and variations can be made to the embodiments without departing from the spirit and scope of the application, which is defined by the claims and their equivalents.
[0313] The above is a specific description of the preferred embodiments of the present application, but the present application is not limited to the embodiments, and those skilled in the art can make various equivalent modifications or replacements without departing from the spirit of the present application, and these equivalent modifications or replacements are included in the scope defined by the claims of the present application.
Claims
1. A method of generating a document, characterized by, The method comprises: in response to a document generation request of a target object, obtaining target business data corresponding to the document generation request; generating an offline document according to the target business data, to obtain an offline document corresponding to the target business data; detecting whether a current online document service is in an available state; if the current online document service is in the available state, converting the offline document into an online document by using the online document service, and feeding back the online document to the target object; if the current online document service is in an unavailable state, feeding back the offline document to the target object.
2. The document generation method of claim 1, wherein, The method comprises: receiving the document generation request of the target object; parsing the document generation request to determine that the document generation request indicates a belonging object corresponding to the exported business data; obtaining identification information of the belonging object, and collecting the target business data according to the identification information; The method further comprises: feeding back the online document to the belonging object.
3. The document generation method of claim 1, wherein, The method further comprises: receiving export configuration information input by a first object; the export configuration information comprises a business name of an executable data export service and data address and data format corresponding to the business name; The method comprises: receiving a document generation request of a target object, and determining a target business name of a data export service that needs to be executed according to the document generation request; determining a target data address and a target data format corresponding to the target business name from the export configuration information; obtaining target business data corresponding to the document generation request according to the target data address and the target data format.
4. The document generation method of claim 3, wherein, The method comprises: obtaining original business data according to the target data address; parsing the target data format to determine a target field name and a target field type specified by the export configuration information; searching for field content matching the target field name and the target field type in the original business data to obtain the target business data.
5. The document generation method of claim 4, wherein, The method comprises: constructing a matching tree model based on an automaton according to the target field name; inputting characters in the original business data into the matching tree model to detect whether there is a character combination matching the target field name in the original business data; if there is a character combination matching the target field name in the original business data, obtaining a field value corresponding to the character combination; if the type of the field value is the target field type, determining the character combination and the field value as field content matching the target field name and the target field type.
6. The document generation method of claim 1, wherein, The method comprises: Converting the offline document into an online document through the online document service, and recording a starting time node of a task of starting to perform the online conversion; Detecting whether the task of the online conversion generates the online document; If a time length from a current time node to the starting time node exceeds a first threshold value, and the task of the online conversion does not generate the online document, determining that the online document service is currently in an unavailable state.
7. The document generation method of claim 6, wherein, The detecting whether the task of the online conversion generates the online document comprises: Detecting a historical time node of last sending an inquiry signal; wherein the inquiry signal is used to inquire whether the task of the online conversion generates the online document; If the inquiry signal sent last indicates that the task of the online conversion does not generate the online document, and a time length from a current time node to the historical time node reaches a second threshold value, resending the inquiry signal, and returning to the step of detecting the historical time node of last sending the inquiry signal.
8. The document generation method of claim 1, wherein, The if the online document service is currently in an available state, converting the offline document into an online document by using the online document service comprises: If the online document service is currently in an available state, generating a first asynchronous task; the first asynchronous task is used to convert the offline document into the online document; Executing the first asynchronous task, and returning a first task identification of the first asynchronous task; Periodically polling a completion state of the first asynchronous task according to the first task identification by using the online document service, and obtaining the online document.
9. The document generation method of claim 1, wherein, The method further comprises: In response to a document generation request of the target object, generating a second asynchronous task; the second asynchronous task is used to execute a document generation task corresponding to the document generation request; Feeding back prompt information to the target object; wherein the prompt information is used to inform the target object of a target channel of receiving the online document or the offline document; Executing the second asynchronous task, and feeding back the online document or the offline document to the target object through the target channel.
10. The document generation method of any one of claims 1-9, wherein, The method further comprises: According to an editing operation of the target object, updating the offline document, and once the online document service becomes available, converting the updated offline document into an online document by using the online document service, and feeding back the online document to the target object.
11. The document generation method of claim 10, wherein, The once the online document service becomes available, converting the updated offline document into an online document by using the online document service, and feeding back the online document to the target object comprises: Obtaining a state parameter of the online document service; Based on the state parameter, predicting a fault recovery time of the online document service by using a prediction model; According to the fault recovery time, polling a state of the online document service, so as to convert the updated offline document into an online document by using the online document service, and feed back the online document to the target object when it is determined that the online document service becomes available.
12. A document generation system characterized by comprising: The system comprises: An acquisition unit is configured to acquire target service data corresponding to a document generation request of a target object in response to the document generation request; A generation unit is configured to generate an offline document according to the target service data, so as to obtain an offline document corresponding to the target service data; A detection unit is configured to detect whether a current online document service is in an available state; A conversion unit is configured to convert the offline document into an online document by using the online document service and feed back the online document to the target object if the current online document service is in the available state; A processing unit is configured to feed back the offline document to the target object if the current online document service is in an unavailable state.
13. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the document generation method in any one of claims 1 to 11.
14. A computer readable storage medium, the storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the document generation method in any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the document generation method in any one of claims 1 to 11.