A file generation method, device, electronic device and storage medium
The compiled table and chart files are generated through inter-process calls in C++ and Python, which solves the problem of data explosion in the business platform and improves the data understanding efficiency and platform operation monitoring capabilities of operation and maintenance personnel.
Patent Information
- Application Number
- CN202410840367.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2044-06-26
AI Technical Summary
In the business platform, as the number of users increases, the recorded data grows explosively, making it difficult for platform maintenance personnel to understand the user feedback and operation status of the services provided by the platform.
Through a file generation method, C++ and Python inter-process calls are used to generate files containing tables and/or charts, JSON text is used to record content attributes and source data, and organized files are generated through a table file creation library to simplify data analysis and exhibit.
The generated files are easy to understand the source data, and the tables and charts are well integrated. They can understand the operation of the business platform in a timely manner, improve the work efficiency of operation and maintenance personnel, and ensure the accuracy and richness of the data.
Smart Images

Figure CN118394718B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a file generation method, device, electronic device and storage medium. Background Art
[0002] Various business platforms can provide various services to users. At the same time, the business platforms will also record various data generated in the process of providing services to users. As the number of users of the business platform increases, the various data recorded by the business platform also shows explosive growth, which is very unfavorable for platform maintenance personnel to understand user feedback and other information about the services provided by the platform based on these data, and thus it is not conducive to platform maintenance personnel to understand the operation of the platform.
[0003] To this end, it is necessary to provide a file generation solution after organizing the above data, so that platform maintenance personnel can understand the operation status of the platform. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a file generation method, device, electronic device and storage medium to generate a file after sorting business data. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a method for generating a file, the method comprising:
[0006] The first process determines, in response to a file generation operation, content attributes of a file to be generated and source data of the file to be generated, and generates a JSON text containing the content attributes and the source data, wherein the content attributes include: table attributes and / or chart attributes, and the first process is a C++ process;
[0007] The first process calls a second process, wherein the second process is a Python process;
[0008] The second process generates a file including a table and / or a chart based on the JSON text.
[0009] In one embodiment of the present application, the second process generates a file containing a table and / or a chart based on the JSON text, including:
[0010] The second process calls the table file creation library through the access interface of the table file creation library, creates a table file, and adds a table and / or chart in the table file based on the content attributes and source data contained in the JSON text.
[0011] In one embodiment of the present application, after the first process generates the JSON text containing the content attributes and the source data, it further includes:
[0012] The first process writes the JSON text into a first free area in a preset memory space;
[0013] After the first process calls the second process, the method further includes:
[0014] The second process reads the JSON text from the first area.
[0015] In one embodiment of the present application, the first process writes the JSON text into a first free area in a preset memory space, including:
[0016] The first process searches for a continuous memory area of a first length from the head of a preset memory space to the tail of the space based on a sliding window search method, and uses the memory area found for the first time as the first area, wherein the first length is: the length of the JSON text;
[0017] The JSON text is written into the first area based on the first address of the first area and the first length.
[0018] In one embodiment of the present application, the pre-set memory space includes:
[0019] Memory space managed by file mapping, or
[0020] The virtual memory space corresponding to the memory mapping.
[0021] In one embodiment of the present application, the first process calls the second process, including:
[0022] The first process calls the second process using the first address of the preset memory space, the first address of the first area, and the first length of the JSON text as calling parameters.
[0023] In one embodiment of the present application, the method further includes:
[0024] The second process stores the file generation feedback information in the preset memory space, wherein the file generation feedback information includes: file generation result and / or file generation progress information;
[0025] The first process obtains the file generation feedback information from the preset memory space, and provides the file generation feedback to the user.
[0026] In a second aspect, an embodiment of the present application provides a file generation device, the device comprising:
[0027] A text generation module, used for the first process to determine the content attributes of the file to be generated and the source data of the file to be generated in response to the file generation operation, and to generate a JSON text containing the content attributes and the source data, wherein the content attributes include: table attributes and / or chart attributes, and the first process is a C++ process;
[0028] A process calling module, used for the first process to call a second process, wherein the second process is a Python process;
[0029] The file generation module is used for the second process to generate a file containing tables and / or charts based on the JSON text.
[0030] In one embodiment of the present application, the file generation module is specifically used to call the table file creation library through the access interface of the table file creation library, create a table file, and add tables and / or charts in the table file based on the content attributes and source data contained in the JSON text.
[0031] In one embodiment of the present application, the device also includes: a text writing module, which is used for the first process to write the JSON text into a first free area in a preset memory space after the text generation module generates the JSON text; and a text reading module, which is used for the second process to read the JSON text from the first area after the first process calls the second process.
[0032] In one embodiment of the present application, the text writing module is specifically used for the first process to search for a continuous memory area of a first length from the head of a preset memory space to the tail of the space based on a sliding window search method, and use the memory area found for the first time as the first area, wherein the first length is: the length of the JSON text; based on the starting address of the first area and the first length, the JSON text is written to the first area.
[0033] In one embodiment of the present application, the pre-set memory space includes: a memory space managed by file mapping, or a virtual memory space corresponding to the memory mapping.
[0034] In one embodiment of the present application, the process calling module is specifically used for the first process to call the second process with the first address of the preset memory space, the first address of the first area and the first length of the JSON text as calling parameters.
[0035] In one embodiment of the present application, the device further comprises: a file storage module, configured for the second process to store file generation feedback information into the preset memory space, wherein the file generation feedback information comprises: file generation result and / or file generation progress information;
[0036] The information feedback module is used for the first process to obtain the file generation feedback information from the preset memory space and provide the file generation feedback to the user.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0038] Memory, used to store computer programs;
[0039] The processor is used to implement the method described in the first aspect when executing the program stored in the memory.
[0040] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.
[0041] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method described in the first aspect above.
[0042] Beneficial effects of the embodiments of the present application:
[0043] As can be seen from the above, in the solution provided by the embodiment of the present application, in the case of a file generation operation, the first process responds to the above file generation operation, generates a JSON text containing the content attributes of the file to be generated and the source data, and calls the second process. Since the JSON text records whether the file to be generated contains a table, a chart, or both, and records the table attributes and / or chart attributes, the second process analyzes the source data based on the JSON text, and can well organize the source data, and then generate a table and / or chart that is consistent with the table attributes and / or chart attributes contained in the JSON text. In addition, since the table and the chart have better integration with respect to the source data, the solution provided by the embodiment of the present application can be applied to generate the organized file, and the file generated in this way is convenient for personnel to understand the situation reflected by the source data.
[0044] In addition, in the solution provided in the embodiment of the present application, the first process is a C++ process, and the second process is a Python process. Python has a powerful Python library. In this way, through inter-process calls between C++ and Python, a more powerful library can be used to implement file generation. Compared with the C process, the callable library has more various function functions, and the tables and charts that can be generated are richer.
[0045] In addition, the files containing tables and / or charts are obtained by analyzing the source data. If the above source data changes, the tables and / or charts in the above files will also change with the source data.
[0046] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0048] Figure 1 A schematic diagram of the contents of a file containing tables and charts provided in an embodiment of the present application;
[0049] Figure 2 A flowchart of a file generation method provided in an embodiment of the present application;
[0050] Figure 3 A flowchart of another file generation method provided in an embodiment of the present application;
[0051] Figure 4 A flowchart of a text writing method provided in an embodiment of the present application;
[0052] Figure 5 A schematic diagram of memory space pre-set in various situations provided in an embodiment of the present application;
[0053] Figure 6 A signaling diagram of a file generation method provided in an embodiment of the present application;
[0054] Figure 7 A schematic diagram of the structure of a file generation device provided in an embodiment of the present application;
[0055] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0057] Nowadays, various business platforms can generate a large amount of business data every day. Whether it is to provide high-quality business services to users or to maintain the high-quality operation of the business platform, the operation and maintenance personnel of the business platform need to pay attention to the large amount of business data generated every day. However, when facing a large amount of business data, the operation and maintenance personnel are easily dazzled and it is difficult to find problems from a pile of data. For this reason, it is necessary to integrate the above-mentioned large amount of data to form a file that is easy for the operation and maintenance personnel to view. In view of this, the embodiment of the present application provides a file generation method, device, electronic device and storage medium to generate a file containing tables and / or charts. Relative to the large amount of business data generated by the above-mentioned business platform every day, the data in the table and / or chart is the data after integration, which is more convenient for personnel to view. In this way, the file generated by the solution provided by the embodiment of the present application is convenient for the operation and maintenance personnel to view, and timely understand the operation of the business platform. If there is a problem, it can be handled in time, so that the business platform can provide high-quality services to users.
[0058] For example, the above-mentioned business platform can be a security platform. For example, for the security platform of a shopping mall, each store as a user of the platform hopes to understand the daily customer flow of the store. To this end, the platform needs to determine the time information of customers entering and leaving the store based on the images captured by the image acquisition device, and use the solution provided in the embodiment of the present application to organize the time information of customers entering and leaving the store, and then generate a file reflecting the store customer flow and with tables and / or charts.
[0059] The above-mentioned business platform can be a warehouse management platform. As a warehouse manager of a platform user, he hopes to understand the usage of the warehouse. To this end, the platform needs to use the solution provided in the embodiment of the present application based on the warehouse's item entry and exit records, and organize the data of the item entry and exit records, and then generate a file that reflects the warehouse usage and contains tables and / or charts.
[0060] First, the execution subject of the scheme provided by the embodiment of the present application is described. The file generation scheme provided by the embodiment of the present application can be run on an electronic device, that is, the execution subject of the scheme provided by the embodiment of the present application is an electronic device, and the electronic device creates a first process and a second process during the working process. The work performed by the first process and the second process respectively is described in detail in the subsequent embodiments. In addition, from the perspective of the form of the electronic device, the above-mentioned electronic device can be a server, desktop, laptop, tablet, mobile phone, etc. of a business platform, and various devices with data processing functions are not limited to this by the embodiment of the present application.
[0061] The concepts involved in the embodiments of the present application are explained below.
[0062] 1. Content attributes of the file to be generated
[0063] From the foregoing description, it can be seen that the file generated by applying the solution provided by the embodiment of the present application is a file containing a table and / or a chart. On this basis, the content attributes of the file to be generated include: table attributes and / or chart attributes. That is, if the file to be generated includes a table, the content attributes of the file to be generated include table attributes, and if the file to be generated includes a chart, the content attributes of the file to be generated include chart attributes.
[0064] Among them, whether the file to be generated includes a table or a chart, or both, can be set by default in the above-mentioned electronic device, or can be specified by the user. In addition, the file to be generated can include one table or multiple tables, and the table attributes of different tables can be the same or different. Similarly, the file to be generated can include one chart or multiple charts, and the table attributes of different charts can be the same or different.
[0065] Furthermore, the embodiment of the present application does not limit the format of the file to be generated. For example, the file to be generated may be a file format supported by Excel, or a file format supported by WPS, etc.
[0066] 2. Tables and table properties
[0067] A table, also known as a table, is both a visual communication mode and a means of organizing and collating data. It refers to a written material that is drawn into a grid according to the required content items and filled with text or numbers for easy statistical viewing. Specifically, a table consists of one or more rows of cells, which are used to display numbers and other items for quick reference and analysis. Among them, the items in the table are organized into rows and columns, and the header generally refers to the first row of the table, indicating the content and meaning of each column of the table. For example, Figure 1The first to third rows and two columns labeled A and B form a table with a total of 6 cells. The first row is the table header, which contains two fields: "Name" and "Combat Power". "MM" and "NN" are the field values of "Name", and 70 and 99 are the field values of "Combat Power".
[0068] Table attributes can be understood as description information of the table format. For example, table attributes can include at least one of the following information: cell format information, cell column width attribute, cell row height attribute, cell merge attribute, and cell text information.
[0069] The cell format information may include: whether the text in the cell is bold, the alignment of the text in the cell, the font color of the text in the cell, the background color of the cell, the format of the text in the cell, such as string type, number type, formula type, text type, etc.;
[0070] Cell column width properties can include: the width of each column of cells;
[0071] The cell row height attributes may include: the height of each row of cells;
[0072] Cell merging properties can include: which cells need to be merged;
[0073] The cell text information may include: the field or field value represented by the cell row, the field or field value represented by the cell column, the source data corresponding to the cell row, and the source data corresponding to the cell column.
[0074] The embodiment of the present application only uses the above content as an example to illustrate the table attributes, and the table attributes are not limited to this.
[0075] 3. Charts and Chart Properties
[0076] A chart is a graphic structure that represents data in a graphical way. It is a good means of visualizing data in an intuitive and vivid way. A chart is divided into two parts: the header and the data area. For example, Figure 1 The area where the two rectangles are shown is the chart, wherein the area where "combat power" is located is the header area, and the area where the two rectangles, the numbers 0-120, and "MM" and "NN" are located is the data area.
[0077] Charts can be divided into many types, for example, bar charts, column charts, line charts, pie charts, scatter charts, area charts, donut charts, radar charts, bubble charts, etc. In addition, different types of charts can be superimposed on each other to form composite chart types.
[0078] The chart attributes can be understood as the descriptive information of the format of the chart included in the file to be generated. For example, the chart attributes may include at least one of the following information: whether it includes a single chart or a combination chart, if a combination chart is included, which chart is the main chart and which chart is the secondary chart, and the specific chart attributes of each chart.
[0079] Since different types of charts may have different components, such as line charts have coordinate axes, while pie charts do not, the specific chart attributes of different types of charts may include different contents. However, in summary, the specific chart attributes of a chart may include at least one of: title, scale, legend, and body. For example, the specific chart attributes of a chart may include at least one of: chart type, title, scale of the X-axis, scale of the Y-axis, legend of the X-axis, legend of the Y-axis, field represented by the X-axis, field represented by the Y-axis, source data range represented by the X-axis, and source data range represented by the Y-axis.
[0080] For example, Figure 1 The icon shown is a bar chart. The X-axis represents "name" and the Y-axis represents "combat power". The range of the data represented by the X-axis is Figure 1 The data in cells A2 and A3 in the table shown, the range of data represented by the Y axis is Figure 1 The data in cells B2 and B3 in the table shown.
[0081] 4. Source data of the file to be generated
[0082] The source data of the file to be generated refers to the original data used to generate the tables and charts in the file to be generated. Taking the above-mentioned business platform generating tables as an example, the above-mentioned source data are various business data recorded by the business platform, for example, the time information of customers entering and leaving the store determined by the security platform based on the images collected by the image acquisition device, and the records of goods leaving and entering the warehouse recorded by the warehouse management platform.
[0083] That is to say, the above-mentioned source data is the object that is analyzed and sorted to generate tables and / or charts.
[0084] The above-mentioned source data can be stored in a dedicated data storage device, which can be a distributed data storage device or a non-distributed data storage device, and the embodiments of the present application are not limited to this.
[0085] JSON
[0086] JSON (JavaScript Object Notation) is a lightweight data exchange format. It is based on a subset of ECMAScript (the js specification developed by the European Computer Manufacturers Association) and uses a text format that is completely independent of the programming language to store and represent data. The simplicity and clear hierarchical structure make JSON an ideal data exchange language. It is easy for programmers to read and write, and it is also easy for machines to parse and generate, and can effectively improve network transmission efficiency.
[0087] The file generation method provided in the embodiment of the present application is described in detail below in conjunction with specific embodiments.
[0088] In one embodiment of the present application, see Figure 2 , a flow chart of a file generation method is provided, the method comprises the following steps S201-S203.
[0089] Step S201: In response to a file generation operation, the first process determines content attributes of a file to be generated and source data of the file to be generated, and generates a JSON text containing the content attributes and the source data.
[0090] The first process is a C++ process, that is, the first process is run based on a code written in C++. When executing the solution provided in the embodiment of the present application, the first process is a process that has been created.
[0091] Specifically, the file generation operation can be an operation in which a user clicks a file generation button in the client operation interface, or it can be an operation in which the business platform automatically triggers the file generation operation at a preset time, for example, the business platform triggers the file generation operation at 1 a.m. every day.
[0092] In addition, the above-mentioned file generation operation can be detected by the first process. In this case, after the user clicks the file generation button or the business platform triggers the operation of generating a file, the first process will detect the file generation operation, and the first process will start to respond to the file generation operation.
[0093] Furthermore, the above-mentioned file generation operation can be detected by other processes, for example, a third process. In this case, after the third process detects the file generation operation, it can notify the first process through the inter-process communication mechanism, and then the first process responds to the file generation operation.
[0094] The specific implementation method for determining the content attributes and source data of the file to be generated is described below.
[0095] In one implementation, the business platform can pre-generate file templates for various businesses, in which the table attributes of the tables and / or the icon attributes of the charts contained in the files, as well as the information of the source data, are defined. In this case, the electronic device can search for the file template corresponding to the business indicated by the file generation operation from the various pre-generated file templates based on the business indicated by the file generation operation, and then determine the content attributes of the file to be generated and the source data of the file to be generated based on the table attributes and / or chart attributes defined in the found file template, as well as the information of the source data. Specifically, the table attributes and / or chart attributes defined in the found file template are determined as the content attributes of the file to be generated, and data positioning is performed based on the source data information defined in the found file template, and the positioned data is used as the source data of the file to be generated. Among them, the above-mentioned source data information may include: the generation time period of the source data, the storage location, etc.
[0096] In another implementation, the user may also set the content attributes of the file to be generated and the information of the source data of the file to be generated in the interactive interface, so that the content attributes and the source data of the file to be generated can be directly obtained based on the user's setting operation.
[0097] After determining the content attributes of the file to be generated and the source data of the file to be generated, the electronic device generates a text in JSON format and records the above content attributes and source data in the text.
[0098] It is worth mentioning that after the above-mentioned first process is successfully created, it can remain in working state. At this time, every time a file generation operation occurs, the first process can respond to a file generation operation and provide JSON text for multiple file generation.
[0099] Step S202: The first process calls the second process.
[0100] Among them, the second process is a Python process, that is, the second process is run based on the code written in Python. The above-mentioned code written based on Python can be located in a packaged file, so that the above-mentioned packaged file can be called a Python packaged file, and the above-mentioned second process can be called a Python packaged process. When executing the solution provided in the embodiment of the present application, the second process can be a process that has been created. Of course, the second process can also be a process that has not been created yet. In this case, the second process needs to be created first, and then the first process can successfully call the second process.
[0101] After the first process calls the second process, the second process can execute the encapsulated code.
[0102] Specifically, the first process may call the second process through command line parameters. The first process may also send a call message to the second process, thereby calling the second process.
[0103] Step S203: The second process generates a file containing a table and / or a chart based on the JSON text.
[0104] If the JSON text contains a table attribute, the file generated by the second process contains a table; if the JSON text contains a chart, the file generated by the second process contains a chart.
[0105] Before generating the file, the second process needs to obtain the JSON text. Specifically, in one implementation, after the first process generates the JSON text, it can store the JSON text in a set storage area, so that the second process can read the above JSON text from the set storage area; in another implementation, the second process can obtain the JSON text generated by it from the first process through inter-process communication.
[0106] The specific implementation method of generating files by the second process is described below.
[0107] In one implementation, the second process can call the table file creation library through the access interface of the table file creation library, create a table file, and then add a table and / or chart to the table file based on the content attributes and source data contained in the JSON text. In this way, a file containing a table and / or chart can be generated conveniently.
[0108] Specifically, the second process can call the function used to create table files in the table file creation library through the access interface of the table file creation library to create a table file, and then call the table generation function and / or the chart generation function to analyze the source data recorded in the JSON text, generate tables and / or charts according to the table attributes and / or chart attributes recorded in the JSON text, and then add the generated tables and / or charts to the above-mentioned created table files.
[0109] For example, the table file creation library may be xlsxwriter. Compared with the traditional C library, this can overcome the problem that libxlsxwriter in the C library cannot generate a combined chart. The second process can generate a combined chart by calling the function in xlsxwriter, so that the source data can be better organized to obtain a file that can better reflect the rules in the source data.
[0110] Since the above tables and / or charts are generated based on the analysis results of the source data, they are closely related to the source data. Changes in the source data will directly lead to changes in the tables and / or charts, that is, the tables and / or charts change with the source data. For example, if the source data decreases, the content corresponding to the reduced source data will be reduced in the table and / or chart. Conversely, if the source data increases, the content corresponding to the increased source data will be increased in the table and / or chart.
[0111] In another implementation, the second process may encapsulate codes for generating tables and charts. After being called, the second process runs the encapsulated codes to generate tables and / or charts, thereby obtaining a file containing the generated tables and / or charts.
[0112] As can be seen from the above, in the solution provided by the embodiment of the present application, in the case of a file generation operation, the first process responds to the above file generation operation, generates a JSON text containing the content attributes of the file to be generated and the source data, and calls the second process. Since the JSON text records whether the file to be generated contains a table, a chart, or both, and records the table attributes and / or chart attributes, the second process analyzes the source data based on the JSON text, and can well organize the source data, and then generate a table and / or chart that is consistent with the table attributes and / or chart attributes contained in the JSON text. In addition, since the table and the chart have better integration with respect to the source data, the solution provided by the embodiment of the present application can be applied to generate the organized file, and the file generated in this way is convenient for personnel to understand the situation reflected by the source data.
[0113] In addition, in the solution provided in the embodiment of the present application, the first process is a C++ process, and the second process is a Python process. Python has a powerful Python library. In this way, through inter-process calls between C++ and Python, a more powerful library can be used to implement file generation. Compared with the C process, the callable library has more various function functions, and the tables and charts that can be generated are richer.
[0114] In addition, the files containing tables and / or charts are obtained by analyzing the source data. If the above source data changes, the tables and / or charts in the above files will also change with the source data.
[0115] From the above description, after the first process generates the JSON text, the JSON text can be stored in a set storage area, and then the second process reads the JSON text from the set storage area, thereby realizing the acquisition of the JSON text. Based on this, in one embodiment of the present application, see Figure 3, provides a flow chart of another method for generating a file. In the method, after the first process generates a JSON text in the aforementioned step S201, the method further includes the following step S204.
[0116] Step S204: The first process writes the JSON text into a first free area in a preset memory space.
[0117] Specifically, the pre-set memory space may be a memory space managed by file mapping, or a virtual memory space corresponding to memory mapping.
[0118] Among them, file mapping refers to the mapping from a file to a piece of memory, so that a piece of memory space can be reserved for the file through the mapping from file to memory, and correspondingly it can also be understood that the file mapping manages a piece of memory space, for example, 48MB, 60MB, etc. Based on this, when the above-mentioned pre-set memory space is the memory space managed by the file mapping, the first process writes the above-mentioned JSON text into a free area in the space managed by the file mapping, and this area is called the first area. After the data is stored in the memory area managed by the file mapping, that is, after the data is stored in the first area, the address of the first area is notified to the process to read the data, and this process can realize data reading based on the address of the above-mentioned first area. In the above process, if the memory address to be written to the data is located in the memory page, or the memory page stores the data to be read, no I / O operation is involved. Otherwise, that is, the address of the write operation or the read operation is not found, and a page fault interrupt is triggered at this time, and the I / O operation is involved. Therefore, whether it is writing data to the first area or reading data from the first area, the I / O operation will be greatly reduced, which can greatly improve the efficiency of file operations.
[0119] Memory mapping corresponds to a corresponding virtual memory space. Through memory mapping, files can be stored in the corresponding virtual memory space. In this way, the contents of the file can be operated like operating the memory, thereby reducing the I / O operations on the disk during the file reading and writing process, improving the efficiency of file reading and writing, and greatly improving the efficiency of file operations.
[0120] The above method of writing the JSON text into the first area is described in the subsequent embodiments and will not be described in detail here.
[0121] On the basis of the aforementioned step S204, the following step S205 is also included after the aforementioned step S202.
[0122] Step S205: The second process reads the JSON text from the first area.
[0123] Specifically, the second process can obtain the first address of the preset memory space, the first address of the first area and the first length of the JSON text, and then determine the starting storage position of the JSON text in the preset memory space based on the above-mentioned first address of the preset memory space and the first address of the first area, and then offset the first length on the basis of the starting storage position to obtain the ending storage position of the JSON text, so as to read the data from the starting storage position to the ending storage position to obtain the JSON text.
[0124] Among them, the first address of the above-mentioned first area can be the relative address of the first area in a preset memory space, so that the starting storage position of the JSON text can be determined by accumulating the first address of the first area based on the first address of the preset memory space.
[0125] It can be seen that in the solution provided by this embodiment, the first process writes the JSON text into the idle first area, that is, allocates storage space for the JSON text and performs a write operation, and then the second process reads the data from the first area. In this way, for the JSON text, writing data and reading data are completed by two different processes. As long as the first process completes data writing, the second process can read the data and generate a file, so that the second process reading data from the first area will not be affected by the first process.
[0126] In addition, it can be seen from the above that for each file generation operation, the storage area of the JSON text is determined by the first process, thereby achieving centralized memory allocation. Furthermore, since each time memory space is allocated for the JSON text, the allocated memory space is free memory space, so for different files to be generated, the JSON texts required are stored in different areas respectively, and the data are isolated from each other, thereby increasing data security.
[0127] In one embodiment of the present application, a first preset number of threads can be created in the first process at most, and these threads can run in parallel. The above-mentioned first preset number can be equal to 6, 8, etc. Based on this, the response file generation operation can be responded to by the thread created by the first process, and one file generation operation is responded by one thread, that is, for one file generation operation, determining the content attributes and source data of the file to be generated, and generating the JSON text containing the content attributes and source data are all completed by the above-mentioned thread. On this basis, calling the second process is also performed by the thread. Since the first process can create multiple threads, these threads can run in parallel, and one file generation operation is responded by one thread, so the first process can respond to multiple file generation operations in parallel, so the solution provided by the application embodiment of the present application can respond to multiple file generation operations in parallel, thereby improving the efficiency of file generation.
[0128] Based on the above, when a thread in the first process calls the second process, it can be implemented in the following two ways.
[0129] Implementation method 1: different threads in the first process call different second processes, and each second process is responsible for generating different files containing tables and / or charts. These different second processes can run in parallel. In this case, the thread in the first process can call the second process in the form of command line parameters.
[0130] Since different threads in the first process can call different second processes to generate files, the solution provided by the embodiment of the present application can generate multiple files containing tables and / or charts in parallel, thereby improving the efficiency of file generation.
[0131] Implementation method 2, similar to the first process, a second preset number of threads can be created in the second process at most, and these threads can also run in parallel. The second preset number may be equal to or different from the first preset number. In this case, the second process generates a file with tables and / or charts, which can also be completed by a thread created by the second process. Based on this, a thread in the first process can call a thread in the second process. In this case, when a thread in the first process calls a thread in the second process to generate a file, the thread in the first process can send a call message to the main thread of the second process, and then the main thread calls other threads in the second process, and the other threads are responsible for generating files containing tables and / or charts.
[0132] Since a thread in the first process can call a thread in the second process to generate a file, when multiple threads in the first process call multiple threads in the second process in parallel, the multiple threads in the second process can generate files containing tables and / or charts in parallel. Therefore, the solution provided in the embodiment of the present application can generate multiple files containing tables and / or charts in parallel, thereby improving file generation efficiency.
[0133] The following is an explanation of the aforementioned method of writing the JSON text into the first area.
[0134] In one embodiment of the present application, see Figure 4 , a flowchart of a text writing method is provided, the method comprising the following steps S401-S402.
[0135] Step S401, the first process searches for a continuous memory area of a first length from the head of a preset memory space to the tail of the space based on a sliding window search method, and uses the memory area found for the first time as the first area.
[0136] Among them, the first length is: the length of the JSON text.
[0137] First, a sliding window is set, the length of which is greater than or equal to the above-mentioned first length, and then the above-mentioned sliding window is placed at the space head of a preset memory space, that is, the window head of the sliding window is placed at the space head of the above-mentioned memory space, and it is determined whether there is a continuous free area of the first length in the area covered by the sliding window. If so, it means that there is a continuous free area of the first length in the sliding window for the first time, and the continuous free area of the first length in the sliding window is directly determined as the first area. If not, the sliding window is slid toward the space tail of the memory space by a preset step length, and then it is determined again whether there is a continuous free area of the first length in the area covered by the sliding window, and this cycle is repeated until the continuous free area of the first length is found for the first time and is determined as the first area.
[0138] Combine the following Figure 5 The process of determining the first area is described.
[0139] Figure 5 The schematic diagram of the pre-set memory space in various situations is shown. Among them, the memory space 501 is 48MB of free memory space.
[0140] Case 1: The length of the JSON text is 1000 bytes, that is, the first length is 1000 bytes. Assume that the length of the sliding window is 1000 bytes. The sliding window determines the first area in the memory space 501. At this time, the window head of the sliding window is placed at 0 bytes in the memory space 501. At this time, there is a continuous free area of 1000 bytes in length in the sliding window for the first time. Figure 5 As shown in area 1, it can be determined that area 1 is the first area, and its range is [0,999] bytes. It is noted that the memory space at this time is 502.
[0141] Case 2: The length of the JSON text is 2000 bytes, that is, the first length is 2000 bytes. Assume that the length of the sliding window is 2000 bytes. The sliding window determines the first area in the memory space 502. At this time, the window head of the sliding window is placed at 0 bytes in the memory space 502. At this time, [0,999] bytes are occupied in the sliding window, and there is no continuous free area of 2000 bytes in length. The sliding window needs to be moved. Assume that the preset step size is 1000 bytes. After the movement, the window head of the sliding window is located at 1000 bytes in the memory space 502. At this time, there is a continuous free area of 2000 bytes in length in the sliding window for the first time, such as Figure 5 As shown in area 2, it can be determined that area 2 is the first area, and its range is [1000,2999] bytes. Note that the memory space at this time is 503.
[0142] Case three, area 1 in memory space 503 is released, that is, [0,999] bytes are in a free state, but area 2 is still in an occupied state, that is, [1000,2999] bytes are still in an occupied state. The memory space at this time is recorded as 504.
[0143] Case 4: The length of the JSON text is 3000 bytes, that is, the first length is 3000 bytes. Assume that the length of the sliding window is 3000 bytes. The sliding window determines the first area in the memory space 504. At this time, the window head of the sliding window is placed at 0 byte in the memory space 504. Although [0,999] bytes are not occupied in the sliding window, [1000,2999] bytes are occupied. There is no continuous free area of 3000 bytes in length. The sliding window needs to be moved. Assume that the preset step size is 1000 bytes. After the move, the window head of the sliding window is located at 1000 bytes in the memory space 504. At this time, the [1000, 2999] bytes in the sliding window are occupied, and there is no continuous free area of 3000 bytes in length. The sliding window needs to be moved. After moving 1000 bytes, the window head of the sliding window is located at 2000 bytes in the memory space 504. At this time, the [2000, 2999] bytes in the sliding window are occupied, and there is no continuous free area of 3000 bytes in length. After moving 1000 bytes again, the window head of the sliding window is located at 3000 bytes in the memory space 504. At this time, there is a continuous free area of 3000 bytes in length for the first time in the sliding window, such as Figure 5 As shown in area 3, it can be determined that area 3 is the first area, and its range is [3000,5999] bytes. Note that the memory space at this time is 505.
[0144] It should be noted that after the first area is determined, a locking operation needs to be performed on the first area to prevent multiple threads from writing data to the same memory area, which would cause the written data to be destroyed.
[0145] In addition, if the first process fails to find the first area after traversing the preset memory area based on the sliding window, a prompt message can be sent to the user to indicate that the continuous memory space is insufficient. Of course, the first area can also be redetermined starting from the memory head of the preset memory area.
[0146] Step S402: Write the JSON text into the first area based on the first address and the first length of the first area.
[0147] Specifically, the first address of the first area is used as the starting writing address of the JSON text, a writing operation is performed in the first area of the first length, and the JSON text is written into the first area.
[0148] It can be seen that in the solution provided by this embodiment, the first process uses a sliding window method to search for the first area starting from the space header of a pre-set memory space, and determines the continuous memory area of the first length found for the first time as the first area. This can speed up the search speed of the first area, thereby improving the writing speed of the JSON text, and further speeding up the file generation speed.
[0149] From the previous description, the first process can write JSON text into the first area. In order to ensure that the second process can accurately read the JSON text, in one embodiment of the present application, when the first process calls the second process, it is necessary to use a parameter call method to call the second process, and pass the preset first address of the memory space, the first address of the first area and the first length of the JSON text as call parameters to the second process, so that the second process can accurately locate the storage location of the JSON text in the preset memory space based on the preset first address of the memory space, the first address of the first area and the first length of the JSON text. That is, the first process calls the second process with the preset first address of the memory space, the first address of the first area and the first length of the JSON text as call parameters.
[0150] Specifically, the first process may call the second process in the form of command line parameters, with the first address of the memory space, the first address of the first area, and the first length of the JSON text being preset as parameters in the command line.
[0151] In another embodiment of the present application, in order to ensure that the user can grasp the file generation status in time, the second process can store the file generation feedback information in a pre-set memory space. Then, on this basis, the first process obtains the file generation feedback information from the pre-set memory space and provides the file generation feedback to the user.
[0152] The file generation feedback information includes: file generation result and / or file generation progress information.
[0153] Specifically, the file generation result may be a result indicating that the file generation is successful, or a result indicating that the file generation fails. If the file generation is successful, the file generation result may include the generated file; if the file generation fails, the file generation result may include the reason for the file generation failure.
[0154] File generation progress information can be expressed in percentage form or the time required to generate the file.
[0155] In one embodiment of the present application, after the second process stores the file generation feedback information in a pre-set memory space, it can also call the first process with the storage address of the feedback information in the above memory space and the length of the feedback information as parameters, so that the first process obtains the file generation feedback information from the pre-set memory space based on the above storage address and the length of the feedback information.
[0156] Specifically, displaying the file generation feedback information to the user may be that the first process sends the file generation feedback information to the user interaction interface, and then displays the information in the user interaction interface.
[0157] As can be seen from the above, in the solution provided by this embodiment, file generation feedback information can be fed back to the user in a timely manner, so that the user can understand the file generation status in a timely manner, thereby improving the user experience.
[0158] Combine the following Figure 6 A signaling schematic diagram of the file generation method is shown, and then the file generation method provided in the embodiment of the present application is explained.
[0159] Process A and process B are created in the electronic device, wherein multiple threads are created in process A. In addition, the electronic device pre-creates a file mapping object and completes the file mapping.
[0160] The user wants to export a file with tables and charts, so the user clicks a file generation button on the user operation interface of the electronic device, and the electronic device receives a file generation operation. In this case, the above process A responds to the file generation operation, and specifically, thread 1 created by process A responds to the file generation operation.
[0161] Thread 1 determines the content attributes of the file to be generated and the source data of the file to be generated, and generates a JSON text containing the content attributes and the source data; based on a sliding window search method, thread 1 searches for a continuous memory area of a first length from the head of the memory space managed by the file mapping object to the tail of the space. If a continuous memory area of the first length is found, it is called a successful match, and the memory area that is successfully matched for the first time is used as the first area; the first address of the first area is obtained, and based on the first address and the first length of the first area, the JSON text is written into the first area.
[0162] Thread 1 calls process B in the form of command line parameters, where the calling parameters include the first address of the memory space managed by the file mapping object, the first address of the first area, and the first length of the JSON text.
[0163] At this time, thread 1 waits for process B to execute the file generation operation until process B completes the file generation.
[0164] Process B reads the JSON text in the first area based on the first address of the memory space, the first address of the first area, and the first length of the JSON text, and generates a file based on the JSON text.
[0165] Process B stores the file generation feedback information in a preset memory space, and calls thread 1 with the storage address of the file generation feedback information in the memory space and the length of the file generation feedback information as parameters.
[0166] Thread 1 obtains file generation feedback information from a preset memory space and provides file generation feedback to the user.
[0167] Corresponding to the above-mentioned file generation method, an embodiment of the present invention further provides a file generation device.
[0168] In one embodiment of the present application, see Figure 7 , a schematic diagram of the structure of a file generating device is provided, the device comprising:
[0169] A text generation module 701 is used for the first process to determine the content attributes of the file to be generated and the source data of the file to be generated in response to the file generation operation, and to generate a JSON text containing the content attributes and the source data, wherein the content attributes include: table attributes and / or chart attributes, and the first process is a C++ process;
[0170] A process calling module 702, configured for the first process to call a second process, wherein the second process is a Python process;
[0171] The file generation module 703 is used for the second process to generate a file containing a table and / or a chart based on the JSON text.
[0172] As can be seen from the above, in the solution provided by the embodiment of the present application, in the case of a file generation operation, the first process responds to the above file generation operation, generates a JSON text containing the content attributes of the file to be generated and the source data, and calls the second process. Since the JSON text records whether the file to be generated contains a table, a chart, or both, and records the table attributes and / or chart attributes, the second process analyzes the source data based on the JSON text, and can well organize the source data, and then generate a table and / or chart that is consistent with the table attributes and / or chart attributes contained in the JSON text. In addition, since the table and the chart have better integration with respect to the source data, the solution provided by the embodiment of the present application can be applied to generate the organized file, and the file generated in this way is convenient for personnel to understand the situation reflected by the source data.
[0173] In addition, in the solution provided in the embodiment of the present application, the first process is a C++ process, and the second process is a Python process. Python has a powerful Python library. In this way, through inter-process calls between C++ and Python, a more powerful library can be used to implement file generation. Compared with the C process, the callable library has more various function functions, and the tables and charts that can be generated are richer.
[0174] In addition, the files containing tables and / or charts are obtained by analyzing the source data. If the above source data changes, the tables and / or charts in the above files will also change with the source data.
[0175] In one embodiment of the present application, the file generation module is specifically used to call the table file creation library through the access interface of the table file creation library, create a table file, and add a table and / or chart to the table file based on the content attributes and source data contained in the JSON text. In this way, a file containing a table and / or chart can be generated conveniently.
[0176] In one embodiment of the present application, the device also includes: a text writing module, which is used for the first process to write the JSON text into a first free area in a preset memory space after the text generation module generates the JSON text; and a text reading module, which is used for the second process to read the JSON text from the first area after the first process calls the second process.
[0177] It can be seen that in the solution provided by this embodiment, the first process writes the JSON text into the idle first area, that is, allocates storage space for the JSON text and performs a write operation, and then the second process reads the data from the first area. In this way, for the JSON text, writing data and reading data are completed by two different processes. As long as the first process completes data writing, the second process can read the data and generate a file, so that the second process reading data from the first area will not be affected by the first process.
[0178] In addition, it can be seen from the above that for each file generation operation, the storage area of the JSON text is determined by the first process, thereby achieving centralized memory allocation. Furthermore, since each time memory space is allocated for the JSON text, the allocated memory space is free memory space, so for different files to be generated, the JSON texts required are stored in different areas respectively, and the data are isolated from each other, thereby increasing data security.
[0179] In one embodiment of the present application, the text writing module is specifically used for the first process to search for a continuous memory area of a first length from the head of a preset memory space to the tail of the space based on a sliding window search method, and use the memory area found for the first time as the first area, wherein the first length is: the length of the JSON text; based on the starting address of the first area and the first length, the JSON text is written to the first area.
[0180] It can be seen that in the solution provided by this embodiment, the first process uses a sliding window method to search for the first area starting from the space header of a pre-set memory space, and determines the continuous memory area of the first length found for the first time as the first area. This can speed up the search speed of the first area, thereby improving the writing speed of the JSON text, and further speeding up the file generation speed.
[0181] In one embodiment of the present application, the pre-set memory space includes: a memory space managed by file mapping, or a virtual memory space corresponding to the memory mapping.
[0182] After setting the pre-set memory space as above, if the memory address of the data to be written is located in the memory page, or the memory page stores the data to be read, no I / O operation is involved. Otherwise, that is, the address of the write operation or the read operation is not found, a page fault interrupt is triggered, and the I / O operation is involved. Therefore, whether writing data to the first area or reading data from the first area, the I / O operation will be greatly reduced, which can greatly improve the efficiency of file operations.
[0183] In one embodiment of the present application, the process calling module is specifically used for the first process to call the second process with the first address of the preset memory space, the first address of the first area and the first length of the JSON text as calling parameters. In this way, the second process can accurately locate the storage location of the JSON text in the preset memory space.
[0184] In one embodiment of the present application, the device further comprises: a file storage module, configured for the second process to store file generation feedback information into the preset memory space, wherein the file generation feedback information comprises: file generation result and / or file generation progress information;
[0185] The information feedback module is used for the first process to obtain the file generation feedback information from the preset memory space and provide the file generation feedback to the user.
[0186] As can be seen from the above, in the solution provided by this embodiment, file generation feedback information can be fed back to the user in a timely manner, so that the user can understand the file generation status in a timely manner, thereby improving the user experience.
[0187] Corresponding to the above-mentioned file generation method, an embodiment of the present application also provides an electronic device, a computer-readable storage medium and a computer program.
[0188] The present application also provides an electronic device, such as Figure 8 As shown, including:
[0189] Memory 801, used for storing computer programs;
[0190] The processor 802 is used to implement the aforementioned file generation method when executing the program stored in the memory 801.
[0191] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 802, the communication interface, and the memory 801 communicate with each other via the communication bus.
[0192] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0193] The communication interface is used for communication between the above electronic device and other devices.
[0194] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0195] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0196] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned file generation methods are implemented.
[0197] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any file generation method in the above embodiments.
[0198] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0199] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0200] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, electronic device, computer storage medium, and computer program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0201] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A file generation method, characterized in that: The method comprises: The first process determines, in response to a file generation operation, content attributes of a file to be generated and source data of the file to be generated, and generates a JSON text containing the content attributes and the source data, wherein the content attributes include: table attributes and / or chart attributes, and the first process is a C++ process; The first process calls a second process, wherein the second process is a Python process; The second process generates a file containing a table and / or a chart based on the JSON text; After the first process generates the JSON text including the content attributes and the source data, the process further includes: The first process writes the JSON text into a first free area in a preset memory space; After the first process calls the second process, the method further includes: The second process reads the JSON text from the first area.
2. The method according to claim 1, characterized in that The second process generates a file containing a table and / or a chart based on the JSON text, including: The second process calls the table file creation library through the access interface of the table file creation library, creates a table file, and adds a table and / or chart in the table file based on the content attributes and source data contained in the JSON text.
3. The method according to claim 1, characterized in that The first process writes the JSON text into a first free area in a preset memory space, including: The first process searches for a continuous memory area of a first length from the head of a preset memory space to the tail of the space based on a sliding window search method, and uses the memory area found for the first time as the first area, wherein the first length is: the length of the JSON text; The JSON text is written into the first area based on the first address of the first area and the first length.
4. The method according to claim 1, characterized in that: The pre-set memory space includes: Memory space managed by file mapping, or The virtual memory space corresponding to the memory mapping.
5. The method according to claim 4, characterized in that The first process calls the second process, including: The first process calls the second process using the first address of the preset memory space, the first address of the first area, and the first length of the JSON text as calling parameters.
6. The method according to any one of claims 1 to 5, characterized in that The method further comprises: The second process stores the file generation feedback information in the preset memory space, wherein the file generation feedback information includes: file generation result and / or file generation progress information; The first process obtains the file generation feedback information from the preset memory space, and provides the file generation feedback to the user.
7. A file generating device, characterized in that: The device comprises: A text generation module, used for the first process to determine the content attributes of the file to be generated and the source data of the file to be generated in response to the file generation operation, and to generate a JSON text containing the content attributes and the source data, wherein the content attributes include: table attributes and / or chart attributes, and the first process is a C++ process; A process calling module, used for the first process to call a second process, wherein the second process is a Python process; A file generation module, used for the second process to generate a file containing a table and / or a chart based on the JSON text; The device also includes: a text writing module, which is used for the first process to write the JSON text into a first free area in a preset memory space after the text generating module generates the JSON text; and a text reading module, which is used for the second process to read the JSON text from the first area after the first process calls the second process.
8. The device according to claim 7, characterized in that The file generation module is specifically used to call the table file creation library through the access interface of the table file creation library, create a table file, and add a table and / or chart in the table file based on the content attributes and source data contained in the JSON text; or The text writing module is specifically used for the first process to search for a continuous memory area of a first length from the head of a preset memory space to the tail of the space based on a sliding window search method, and use the memory area found for the first time as the first area, wherein the first length is: the length of the JSON text; based on the first address of the first area and the first length, write the JSON text into the first area; or The pre-set memory space includes: a memory space managed by file mapping, or a virtual memory space corresponding to memory mapping; or The process calling module is specifically used for the first process to call the second process with the first address of the preset memory space, the first address of the first area and the first length of the JSON text as calling parameters; or The device also includes: a file storage module, which is used for the second process to store file generation feedback information to the preset memory space, wherein the file generation feedback information includes: file generation results and / or file generation progress information; an information feedback module, which is used for the first process to obtain the file generation feedback information from the preset memory space and provide the file generation feedback to the user.
9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-6 when executing a program stored in a memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
