Resource export method, device, electronic device and medium

By querying and processing database resources in pages on the server side and splicing and exporting them on the client side, the problem of not being able to export all target resources at once in the existing technology is solved, resource processing efficiency is improved and costs are saved.

CN114372079BActive Publication Date: 2025-09-30BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210028781.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-11
Publication Date
2025-09-30
Estimated Expiration
2042-01-11

AI Technical Summary

Technical Problem

Existing technologies cannot export all target resources at once, which affects resource processing efficiency. In addition, increasing server memory to increase resource volume is costly and has poor sustainability.

Method used

The database resources are queried and processed in pages on the server side. After each page of resources is processed, it is immediately sent to the client browser. The client splices and exports the resources after the server completes the processing. The paging query and batch sending method is used to avoid server crashes.

Benefits of technology

It enables the one-time export of all resources within the user's desired range, improving resource processing efficiency and saving costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114372079B_ABST
    Figure CN114372079B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a resource export method, apparatus, electronic device, and medium. The resource export method comprises: sending a request to export resources to a server; receiving paging resources from the server in batches, wherein each batch of paging resources received in the batches is obtained by the server through a paging query of a database storing the resources; and exporting each batch of paging resources received in the batches after splicing. The resource export method, apparatus, electronic device, and medium disclosed in the present disclosure can export all resources within a user's desired range at once, improving subsequent resource processing efficiency and eliminating the need for additional servers, thereby saving costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of Internet technology, and more specifically, to a resource exporting method, device, electronic device, and medium. Background Art

[0002] In real-world production, it's often necessary to export qualified resources from a system for subsequent resource processing. For example, it's often necessary to export production data from a production management system for data anomaly analysis. However, current resource export technologies cannot export all target resources at once, hindering resource processing efficiency. Summary of the Invention

[0003] The present disclosure provides a resource export method, device, electronic device, and medium to at least solve the problems in the above-mentioned related technologies.

[0004] According to a first aspect of an embodiment of the present disclosure, a resource export method is provided, comprising: sending a request to export resources to a server; receiving paging resources from the server in batches, wherein each batch of paging resources received in batches is obtained by the server by performing a paging query on a database storing the resources; and exporting each batch of paging resources received in batches after splicing.

[0005] Optionally, the exporting of each batch of paging resources received in batches after splicing includes: each time a batch of paging resources is received, splicing the received batch of paging resources with the previously received paging resources; after each batch of paging resources of the resources are all received and spliced, exporting the spliced ​​paging resources.

[0006] Optionally, before sending the request to export the resource to the server, the method further includes: in response to receiving the input to export the resource, establishing a long connection with the server, wherein the channel formed by the long connection is used to receive the paging resource.

[0007] Optionally, the method further includes: disconnecting the long connection established with the server after each batch of paging resources of the resource is completely received.

[0008] According to a second aspect of an embodiment of the present disclosure, a resource export method is provided, comprising: in response to a request for exporting resources sent by a client, performing a paging query on a database storing the resources; sending the paging resources obtained by the paging query to the client in batches, so that the client can export the resources after splicing each batch of paging resources received in batches.

[0009] Optionally, sending the paging resources obtained through paging query to the client in batches includes: after each paging query is performed to obtain a batch of paging resources, calling a refresh method to send the obtained batch of paging resources to the client.

[0010] Optionally, before performing a paging query on the database storing the resource in response to the request for exporting the resource sent by the client, the method further includes: establishing a long connection with the client, wherein the channel formed by the long connection is used to send the paging resource.

[0011] Optionally, the method further includes: disconnecting the long connection established with the client after each batch of paging resources of the resource is completely sent.

[0012] According to a third aspect of an embodiment of the present disclosure, a resource exporting device is provided, comprising: a request sending unit configured to send a request for exporting resources to a server; a resource receiving unit configured to receive paging resources from the server in batches, wherein each batch of paging resources received in batches is obtained by the server by performing a paging query on a database storing the resources; and a resource exporting unit configured to splice and export each batch of paging resources received in batches.

[0013] Optionally, the resource export unit may be configured to splice a batch of paging resources with previously received paging resources each time a batch of paging resources is received; and export the spliced ​​paging resources after each batch of paging resources of the resources is completely received and spliced.

[0014] Optionally, the resource export unit also includes a connection establishment unit, which can be configured to establish a long connection with the server in response to receiving input for exporting the resource before sending the request to export the resource to the server, wherein the channel formed by the long connection is used to receive the paging resource.

[0015] Optionally, the resource export unit further includes a connection closing unit, and the connection closing unit may be configured to disconnect the long connection established with the server after each batch of paging resources of the resource is completely received.

[0016] According to a fourth aspect of an embodiment of the present disclosure, a resource exporting device is provided, comprising: a resource query unit, configured to: in response to a request for exporting resources sent by a client, perform a paging query on a database storing the resources; a resource sending unit, configured to: send the paging resources obtained through the paging query to the client in batches, so that the client can export the resources after splicing each batch of paging resources received in batches.

[0017] Optionally, the resource sending unit may be configured to call a refresh method to send the obtained batch of paging resources to the client each time a paging query is performed to obtain a batch of paging resources.

[0018] Optionally, the resource exporting device further includes a connection establishing unit, which may be configured to establish a long connection with the client before receiving the request to export the resource, wherein the channel formed by the long connection is used to send the paging resource.

[0019] Optionally, the resource exporting device further includes a connection closing unit, and the connection closing unit is configured to disconnect the long connection established with the client after each batch of paging resources of the resource is completely sent.

[0020] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: at least one processor; and at least one memory storing computer-executable instructions, wherein the computer-executable instructions, when executed by the at least one processor, prompt the at least one processor to execute the resource export method according to the first aspect or the resource export method according to the second aspect of the present disclosure.

[0021] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium storing instructions is provided. When the instructions are executed by at least one processor, the at least one processor is prompted to execute the resource export method according to the first aspect or the resource export method according to the second aspect of the present disclosure.

[0022] According to a seventh aspect of an embodiment of the present disclosure, a computer program product is provided, wherein instructions in the computer program product can be executed by a processor of a computer device to complete the resource export method according to the first aspect or the resource export method according to the second aspect of the present disclosure.

[0023] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:

[0024] According to the resource export method, device, electronic device and medium disclosed in the present invention, the resources of the database are queried and processed in pages on the server side. After each page of resources is processed, the processed page resources are immediately sent to the client browser. The client browser splices the received page resources in the order of receipt, and exports the spliced ​​resources after completing the resource processing on the server side. This can achieve a one-time export of all resources within the user's desired range, thereby improving the efficiency of subsequent resource processing.

[0025] In addition, according to the resource export method, device, electronic device and medium disclosed herein, there is no need to add servers, which can save costs.

[0026] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0028] Figure 1 1 is an exemplary system architecture 100 illustrating in which exemplary embodiments of the present disclosure may be applied.

[0029] Figure 2 is a flowchart illustrating a resource export method according to an exemplary embodiment of the present disclosure.

[0030] Figure 3 is a schematic diagram illustrating an operation management interface according to an exemplary embodiment of the present disclosure.

[0031] Figure 4 is a schematic diagram illustrating an operation management interface according to another exemplary embodiment of the present disclosure.

[0032] Figure 5 is a flowchart illustrating a resource exporting method according to another exemplary embodiment of the present disclosure.

[0033] Figure 6 is a block diagram illustrating a resource exporting apparatus according to an exemplary embodiment of the present disclosure.

[0034] Figure 7 is a block diagram illustrating a resource exporting apparatus according to another exemplary embodiment of the present disclosure.

[0035] Figure 8 is a block diagram illustrating an electronic device 800 according to an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0036] In order to enable ordinary people in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0037] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The implementation methods described in the following examples do not represent all implementation methods consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0038] It should be noted that the phrase "at least one of the items" in this disclosure includes three types of parallel situations: "any one of the items", "a combination of any multiple items of the items", and "all of the items". For example, "including at least one of A and B" includes the following three parallel situations: (1) including A; (2) including B; (3) including A and B. For another example, "performing at least one of step 1 and step 2" includes the following three parallel situations: (1) performing step 1; (2) performing step 2; and (3) performing steps 1 and 2.

[0039] Currently, in scenarios involving resource export, a common problem is the inability to export all target resources at once, which affects resource processing efficiency. For example, in an operations system, operators often need to export system data as Excel-type data. However, due to the large size of Excel files, to avoid server paralysis, the server can only limit the number of data that can be exported each time, for example, limiting the export to 500 or 1,000 data items at a time. In this way, operators need to manually divide the data within the expected range, export them one by one according to the divided range, and then manually merge multiple Excel files, which is not convenient and reduces the overall data processing efficiency.

[0040] Related technologies use a method of expanding server memory (for example, increasing the number of servers) to increase the amount of resources that can be exported each time, but this method is extremely costly and has poor sustainability.

[0041] In order to solve the problem of not being able to export all target resources at once and save costs at the same time, the present disclosure proposes a resource export method, device, electronic device and medium. Specifically, the server queries and processes the resources of the database in pages. After each page of resources is processed, the processed page resources are immediately sent to the client browser. The client browser splices the received page resources in the order of receipt, and exports the spliced ​​resources after completing the resource processing on the server. This can achieve the one-time export of all resources within the user's desired range, thereby improving the subsequent resource processing efficiency. In addition, according to the resource export method, device, electronic device and medium disclosed in the present disclosure, there is no need to add servers, which can save costs. Below, reference will be made to Figures 1 to 8 A resource exporting method, apparatus, electronic device, and medium according to exemplary embodiments of the present disclosure are described in detail.

[0042] Figure 1 1 is an exemplary system architecture 100 illustrating in which exemplary embodiments of the present disclosure may be applied.

[0043] like Figure 1 As shown, system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is a medium used to provide a communication link between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. Users can use terminal devices 101, 102, 103 to interact with server 105 via network 104 to receive or send messages (e.g., to send resource export requests or receive resource processing information). Terminal devices 101, 102, 103 may be installed with various applications related to resource processing, such as production management systems and operation systems. Terminal devices 101, 102, 103 may be hardware or software. When terminal devices 101, 102, 103 are hardware, they may be various electronic devices with display screens and capable of resource processing, including but not limited to smartphones, tablet computers, laptop computers, and desktop computers. When the terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above, and can be implemented as multiple software or software modules (for example, to provide distributed services) or as a single software or software module. No specific limitation is given here.

[0044] The server 105 may be a server that provides various services, such as a background server that provides support for multimedia applications installed on the terminal devices 101, 102, and 103. The background server may parse, store, and process received data such as resource export requests.

[0045] It should be noted that the server can be either hardware or software. When the server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server is software, it can be implemented as multiple software programs or software modules (for example, to provide distributed services), or as a single software program or software module. No specific limitations are given here.

[0046] It should be understood that Figure 1 The number of terminal devices, networks, and servers in the embodiment is merely illustrative. Any number of terminal devices, networks, and servers may be provided as required, and the present disclosure does not limit this.

[0047] Figure 2 is a flowchart illustrating a resource export method according to an exemplary embodiment of the present disclosure.

[0048] Reference Figure 2 In step 201, a request to export resources may be sent to the server. Here, the resources are data resources, such as production monitoring data and operations management data. During the storage, processing, and application of data resources, data resources need to flow between different business systems to enable processing and application. This involves exporting data resources between different business systems.

[0049] According to an exemplary embodiment of the present disclosure, before sending a request to export resources to a server, a persistent connection can be established with the server in response to receiving input for exporting resources. Here, the persistent connection forms a channel for receiving resources sent by the server. The input for exporting resources can, for example, be triggered by a user selecting a relevant option on the client. In response to receiving this input, the client first establishes a persistent connection with the server and then sends a request to export resources to the server. Specifically, a persistent connection refers to a TCP (Transmission Control Protocol) persistent connection. A TCP persistent connection maintains the connection characteristics after the connection between the client and the server is established. When using a TCP persistent connection, after a web page is opened, the TCP connection used to transmit HTTP data between the client and the server is not closed. When the client accesses the same server again, the connection is continued. This avoids the additional resource overhead caused by frequent server connection establishment during the resource export process, thereby improving the efficiency of resource export. In some embodiments, servlet.outputstream can be used to establish a TCP persistent connection with the server. Specifically, a servlet is a program running on a web server or application server that acts as an intermediary between requests from the client and the database or application on the HTTP server. The servlet can collect user input from a web form and present records from a database or other source. Outputstream is an output stream that can create a byte output stream and write data (i.e., download data) through the byte output stream. In some embodiments, a long connection can be established with the server in response to receiving input of a user-selected export resource, for example, Figure 3 is a schematic diagram illustrating an operation management interface according to an exemplary embodiment of the present disclosure. Figure 3 301 is a display interface of a user terminal device. Display interface 301 displays an operation management data table 302, which includes a large amount of operation data. 303 is an operation button that prompts the user to export the operation data as an Excel file. The user can trigger resource export by clicking operation button 303.

[0050] After establishing a TCP long connection with the server, a resource export request can be sent to the server through the established resource transmission channel. Here, the resource export request may include information about the amount of resources to be exported and information about the export format of the resources, for example, Figure 3In the scenario shown of exporting operation management data to Excel, the resource export request includes the range of data to be exported (for example, all data in the operation management data table 302 can be exported by clicking the operation button 303, or data in the expected range can be selected in the operation management data table 302 and then the operation button 303 can be clicked to export the data in the selected range) and the exported resource format is an Excel file (for example, the exported file suffix is ​​.xlsx).

[0051] In step 202 , paging resources may be received from a server in batches, wherein each batch of paging resources received in batches is obtained by the server through a paging query on a database storing the resources.

[0052] According to an exemplary embodiment of the present disclosure, each batch of paging resources received from the server has a target format, where the target format is, for example, XML format, etc. The target format can be set according to different export purposes. Specifically, after receiving a request to export resources, the server queries the resources from the database storing the resources in a paged manner, and converts the paging resources obtained from the query into resources with a target format and sends them to the client (e.g., the client browser). Here, the resources sent to the client carry MIME (Multipurpose Internet Mail Extensions) type information, and the client can determine the display method and display form of the received resources through the MIME type information. For example, when exporting resources to excel, the server can specify content-type: application / vnd.ms-excel, and the client knows from the content-type that the resources received from the server can be displayed through the Excel application. In addition, the client can also determine the display form of the target resource based on the content indicated by Content-Disposition (for example, it can be displayed as part of the current page or downloaded and saved locally as an attachment). In a specific implementation process, the server determines the resource range to be queried based on the resource quantity information of the resources to be exported in the received request, and determines the resource export format according to the resource export format information, and then performs a paged query. For example, when exporting operation management data to Excel, the query is performed according to 20 data items per page, and the queried data is converted into XML format (xlsx format is based on Office Open XML format) and sent to the client. In some embodiments, after the server performs a paged query to obtain a batch of paged resources, it calls a refresh method to send the obtained batch of paged resources to the client in batches. Specifically, after each query and processing of a batch of paged resources, the batch of paged resources is read into the server memory buffer, and then the flush refresh method is immediately called to write the batch of paged resources to the client browser. Therefore, the client receives paged resources from the server in batches. Here, due to the use of paged query resources and batch sending of paged resources, the amount of resources read into the server memory buffer can be controlled to avoid the server crashing due to excessive cached data. Therefore, there is no need to avoid server crashes by limiting the amount of resources that can be exported each time. All resources within the expected range can be exported at one time, improving overall resource processing efficiency and convenience.

[0053] In step 203, each batch of paged resources received in batches may be spliced ​​and then exported.

[0054] According to an exemplary embodiment of the present disclosure, each time a batch of paging resources is received, the received batch of paging resources can be spliced ​​with the paging resources received previously, and after each batch of paging resources of the resources requested to be exported are all received and spliced, the spliced ​​paging resources can be exported. Specifically, the user expects to export all resources within the expected range, so after receiving the paging resources from the server in batches, it is necessary to splice each batch of paging resources and then export them at one time to improve the convenience of subsequent resource processing. In other embodiments, after receiving all batches of paging resources, splicing can be performed in the order of reception, and there is no restriction on this. After completing the splicing of all paging resources, the final resource export can be triggered. Specifically, after all the paging resources sent by the server are received, the long connection established with the server can be disconnected (that is, the data flow between the two is closed) to avoid exhausting system resources, and the spliced ​​resources can be displayed in the client interface, for example, Figure 4 is a schematic diagram showing an operation management interface according to another exemplary embodiment of the present disclosure, with reference to Figure 4 In the display interface 401, an operation management data table 402 is displayed, which includes a large amount of operation data. 403 is an operation button that prompts the user to export the operation data as an Excel file, and 404 is a pop-up window displayed after the paging resources are spliced. It includes a prompt message that the data export is successful and an inquiry message asking whether to download the data. The user can perform subsequent data processing according to the information in the pop-up window 404.

[0055] Figure 5 is a flowchart illustrating a resource exporting method according to another exemplary embodiment of the present disclosure.

[0056] Reference Figure 5 In step 501, in response to a request for exporting resources sent by a client, a paged query may be performed on a database storing the resources.

[0057] According to an exemplary embodiment of the present disclosure, before receiving a request to export a resource, a persistent connection must be established with the client. Here, the channel formed by the persistent connection is used to send the resource requested by the client. Here, the persistent connection refers to a TCP persistent connection, which can be established after receiving a connection establishment request issued by the client in response to an input of exporting the resource.

[0058] According to an exemplary embodiment of the present disclosure, after receiving a request to export resources sent by a client, resources can be queried in batches from a database storing resources, and after performing a paging query on the database storing the resources requested to be exported by the client, the paging resources obtained by the query are converted into a target format, and the paging resources with the target format are sent to the client in batches. Specifically, the server determines the resource range of the query according to the resource quantity information of the resources to be exported in the received request and performs a paging query, and then determines the resource export format according to the resource export format information, and converts the format of the paging resources obtained by the paging query into the target format. For example, when exporting operational management data to excel, the query is performed according to 20 data items per page, and the queried data is converted into XML format (xlsx format is based on Office Open XML format). Here, the target format resource carries MIME (Multipurpose Internet Mail Extensions) type information. The client can use the MIME type information to determine the display method and presentation format of the received target resource. For example, when exporting resources to Excel, the server can specify content-type: application / vnd.ms-excel. The client knows from the content-type that the target resource received from the server can be displayed using the Excel application. In addition, the client can also determine the presentation format of the target resource based on the content indicated by the specified Content-Disposition (for example, it can be displayed as part of the current page or downloaded and saved locally as an attachment).

[0059] In step 502 , the paging resources obtained through the paging query may be sent to the client in batches, so that the client can export the paging resources after splicing each batch received.

[0060] According to an exemplary embodiment of the present disclosure, after each paging query is performed to obtain a batch of paging resources, a refresh method is called to send the obtained batch of paging resources to the client. Here, for example, but not limited to, the flush refresh method can be used to send the paging resources to the client. Specifically, after each query and conversion of a batch of paging resources by the server, the batch of paging resources can be read into the server memory buffer, and then the flush refresh method is immediately called to write the batch of resources to the client browser. In addition, according to an exemplary embodiment of the present disclosure, after all the resources requested to be exported by the client are sent, the long connection established between the server and the client can be disconnected, that is, the data flow between the two is closed to avoid exhaustion of system resources. Here, due to the use of paging query elements and the method of sending paging resources in batches, the amount of resources read into the server memory buffer can be controlled to avoid the situation where the server crashes due to the excessive amount of cached data, thereby eliminating the need to avoid server crashes by limiting the amount of resources that can be exported each time. All resources within the expected range can be exported at one time, improving overall resource processing efficiency and convenience.

[0061] To clearly illustrate the solution presented in the present disclosure, the resource export method presented in the present disclosure is generally described below.

[0062] First, in response to receiving the input of exporting resources, the client establishes a long connection with the server to form a data transmission channel with the server. Then the client sends a request to export resources to the server. In response to the request to export resources sent by the client, the server performs a paging query on the database storing the requested exported resources. After each paging query obtains a batch of paging resources, the server immediately calls the refresh method to send the queried batch of paging resources to the client. Each time the client receives a batch of paging resources sent by the server, it splices the received batch of paging resources with the previously received resources. After the client receives and splices all batches of resources sent by the server, it disconnects the long connection with the server and exports the spliced ​​paging resources. This achieves the one-time export of all resources within the expected range, improving the overall resource processing efficiency and convenience.

[0063] Figure 6 is a block diagram illustrating a resource exporting apparatus according to an exemplary embodiment of the present disclosure.

[0064] Reference Figure 6 According to an exemplary embodiment of the present disclosure, a resource exporting apparatus 600 may include a request sending unit 601 , a resource receiving unit 602 , and a resource exporting unit 603 .

[0065] The request sending unit 601 may send a request to export resources to the server. The resource receiving unit 602 may receive paging resources from the server in batches, where each batch of paging resources received is obtained by the server through a paging query of a database storing the resources requested for export. The resource exporting unit 603 may splice each batch of paging resources received in batches and then export them.

[0066] According to a semi-disclosed exemplary embodiment, the resource exporting device 600 may further include a connection establishing unit 604 ( Figure 6 Not shown) and the connection closing unit 605 ( Figure 6 ), wherein the connection establishing unit 604 may establish a persistent connection with the server in response to receiving an input requesting to export resources before sending a request to export resources to the server, wherein the channel formed by the persistent connection is used to receive the paging resources. The connection closing unit 605 may disconnect the persistent connection established with the server after each batch of paging resources requested to be exported has been completely received.

[0067] because Figure 2 The resource export method shown can be used by Figure 6 The resource allocation device 600 shown in FIG. 1 is executed, and the request sending unit 601, the resource receiving unit 602 and the resource exporting unit 603 can respectively execute the same Figure 2 The operations corresponding to step 201, step 202 and step 203 in FIG. Figure 6 Any details about the operations performed by the units in Figure 2 The corresponding description is not repeated here.

[0068] Furthermore, it should be noted that although the resource exporting apparatus 600 is described above as being divided into units for performing corresponding processing, it is clear to those skilled in the art that the processing performed by each of the above-mentioned units can also be performed without any specific unit division or clear demarcation between the units in the resource exporting apparatus 600. Furthermore, the resource exporting apparatus 600 may further include other units, such as a data processing unit, a storage unit, and the like.

[0069] Figure 7 is a block diagram illustrating a resource exporting apparatus according to another exemplary embodiment of the present disclosure.

[0070] Reference Figure 7 According to an exemplary embodiment of the present disclosure, a resource exporting apparatus 700 may include a resource query unit 701 and a resource sending unit 702 .

[0071] The resource query unit 701 can perform a paged query on the database storing the resource in response to a request for exporting the resource sent by the client. The resource sending unit 702 can send the paged resources obtained by the paged query to the client in batches, so that the client can export the received batches of paged resources after splicing them together.

[0072] According to a semi-disclosed exemplary embodiment, the resource exporting device 700 further includes a connection establishing unit 703 ( Figure 7 Not shown) and the connection closing unit 704 ( Figure 7 ), wherein the connection establishment unit 703 may establish a persistent connection with the client before receiving a request to export resources, wherein the channel formed by the persistent connection is used to send the paging resources requested to be exported by the client. The connection closing unit 704 may disconnect the persistent connection established with the client after each batch of paging resources requested to be exported by the client has been completely sent.

[0073] because Figure 5 The resource export method shown can be used by Figure 7 The resource allocation device 700 shown in FIG. 1 is used to execute the resource query unit 701 and the resource sending unit 702 can respectively execute the resource query unit 701 and the resource sending unit 702. Figure 5 The operations corresponding to steps 501 and 502 in FIG. 5 are as follows: Figure 7 Any details about the operations performed by the units in Figure 5 The corresponding description is not repeated here.

[0074] Furthermore, it should be noted that although the resource allocation apparatus 700 is described above as being divided into units for respectively performing corresponding processes, it is clear to those skilled in the art that the processes performed by the aforementioned units can also be performed without any specific unit division or clear demarcation between the units in the resource allocation apparatus 700. Furthermore, the resource allocation apparatus 700 may further include other units, such as a data processing unit, a storage unit, and the like.

[0075] Figure 8 is a block diagram of an electronic device 800 according to an exemplary embodiment of the present disclosure.

[0076] Reference Figure 8 The electronic device 800 includes at least one memory 801 and at least one processor 802, wherein the at least one memory 801 stores a set of computer-executable instructions. When the computer-executable instruction set is executed by the at least one processor 802, the resource export method according to the exemplary embodiment of the present disclosure is executed.

[0077] As an example, the electronic device 800 can be a PC, a tablet device, a personal digital assistant, a smart phone, or other device capable of executing the above-mentioned instruction set. Here, the electronic device 800 is not necessarily a single electronic device, but can also be any device or circuit that can execute the above-mentioned instructions (or instruction sets) individually or in combination. The electronic device 800 can also be part of an integrated control system or system manager, or can be configured as a portable electronic device that is interconnected with a local or remote (e.g., via wireless transmission) interface.

[0078] In electronic device 800, processor 802 may include a central processing unit (CPU), a graphics processing unit (GPU), a programmable logic device, a dedicated processor system, a microcontroller, or a microprocessor. By way of example and not limitation, the processor may also include an analog processor, a digital processor, a microprocessor, a multi-core processor, a processor array, a network processor, etc.

[0079] The processor 802 can execute instructions or codes stored in the memory 801, wherein the memory 801 can also store data. Instructions and data can also be sent and received over the network via the network interface device, wherein the network interface device can use any known transmission protocol.

[0080] The memory 801 can be integrated with the processor 802, for example, by placing RAM or flash memory within an integrated circuit microprocessor or the like. Furthermore, the memory 801 can include a separate device, such as an external disk drive, a storage array, or any other storage device usable by a database system. The memory 801 and the processor 802 can be operatively coupled or can communicate with each other, for example, via an I / O port, a network connection, or the like, such that the processor 802 can access files stored in the memory.

[0081] In addition, the electronic device 800 may further include a video display (such as a liquid crystal display) and a user interaction interface (such as a keyboard, a mouse, a touch input device, etc.) All components of the electronic device 800 may be connected to each other via a bus and / or a network.

[0082] According to an exemplary embodiment of the present disclosure, a computer-readable storage medium storing instructions may also be provided, wherein when the instructions are executed by at least one processor, the at least one processor is prompted to perform the resource export method according to the present disclosure. Examples of computer-readable storage media here include: read-only memory (ROM), random access programmable read-only memory (PROM), electrically erasable programmable read-only memory (EEPROM), random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), flash memory, non-volatile memory, CD-ROM, CD-R, CD+R, CD-RW, CD+RW, DVD-ROM, DVD-R, DVD+R, DVD-RW, DVD+RW, DVD-RAM, BD-ROM, BD-R, BD-R LTH, BD-RE, Blu-ray or optical disk storage, hard disk drive (HDD), solid state drive (SSD), card storage (such as, multimedia card, secure digital (SD) card or ultra-fast digital (XD) card), magnetic tape, floppy disk, magneto-optical data storage device, optical data storage device, hard disk, solid state disk and any other device, any other device configured to store the computer program and any associated data, data files and data structures in a non-transitory manner and provide the computer program and any associated data, data files and data structures to a processor or computer so that the processor or computer can execute the computer program. The computer program in the above-mentioned computer-readable storage medium can be run in an environment deployed in a computer device such as a client, a host, an agent device, a server, etc. In addition, in one example, the computer program and any associated data, data files and data structures are distributed on a networked computer system so that the computer program and any associated data, data files and data structures are stored, accessed and executed in a distributed manner by one or more processors or computers.

[0083] According to an exemplary embodiment of the present disclosure, a computer program product may also be provided. Instructions in the computer program product may be executed by a processor of a computer device to implement the resource export method according to the exemplary embodiment of the present disclosure.

[0084] According to the resource export method, device, electronic device and medium disclosed in the present invention, the resources of the database are queried and processed in pages on the server side. After each page of resources is processed, the processed page of resources is immediately sent to the client browser. The client browser splices the received pages of resources in the order of receipt, and exports the spliced ​​resources after completing the resource processing on the server side. This can achieve a one-time export of all resources within the user's desired range, thereby improving the efficiency of subsequent resource processing.

[0085] In addition, according to the resource export method, device, electronic device and medium disclosed herein, there is no need to add servers, which can save costs.

[0086] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

[0087] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes can be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A resource export method, characterized in that: include: The client sends a request to the server to export resources; The client receives paging resources from the server in batches, wherein each batch of paging resources received in batches is obtained by the server through paging query of a database storing the resources; The client splices and exports each batch of paging resources received in batches; The client performs splicing processing on each batch of paged resources received in batches and then exports the spliced ​​resources, including: Each time the client receives a batch of paging resources, it combines the received batch of paging resources with the paging resources received previously; After each batch of paged resources of the resource is completely received and spliced, the client displays the spliced ​​paged resources.

2. The resource export method according to claim 1, wherein: Before the client sends a request to export resources to the server, the method further includes: In response to receiving the input for exporting the resource, the client establishes a persistent connection with the server, wherein the channel formed by the persistent connection is used to receive the paging resource.

3. The resource export method according to claim 2, wherein: The method further comprises: After each batch of paged resources of the resource is completely received, the client disconnects the long connection established with the server.

4. A resource export method, characterized in that: include: In response to the request for exporting resources sent by the client, the server performs a page query on the database storing the resources; The server sends the paging resources obtained through the paging query to the client in batches, so that the client exports the paging resources after splicing each batch received; The server sends the paged resources obtained through the paged query to the client in batches, including: Each time the server performs a paging query to obtain a batch of paging resources, it calls a refresh method to send the obtained batch of paging resources to the client.

5. The resource export method according to claim 4, wherein: Before the server performs a page query on a database storing the resource in response to the request for exporting the resource sent by the client, the method further includes: The server establishes a persistent connection with the client, wherein the channel formed by the persistent connection is used to send the paging resource.

6. The resource export method according to claim 5, characterized in that: The method further comprises: After each batch of paging resources of the resource is completely sent, the server disconnects the long connection established with the client.

7. A resource export device, characterized in that: Applied to the client, the resource exporting device includes: The request sending unit is configured to: send a request for exporting resources to the server; The resource receiving unit is configured to: receive paging resources from the server in batches, wherein each batch of paging resources received in batches is obtained by the server through paging query of a database storing the resources; The resource export unit is configured to: splice and process each batch of paged resources received in batches and then export them; Wherein, the resource export unit is configured to: Each time a batch of paging resources is received, the received batch of paging resources is spliced ​​with the previously received paging resources; After each batch of paged resources of the resource is completely received and spliced, the spliced ​​paged resources are displayed.

8. The resource exporting device according to claim 7, wherein: The invention also includes a connection establishing unit configured to: Before sending the request to export the resource to the server, in response to receiving the input to export the resource, a persistent connection is established with the server, wherein the channel formed by the persistent connection is used to receive the paging resource.

9. The resource exporting device according to claim 8, wherein: Also included is a connection closing unit configured to: After each batch of paging resources of the resource is completely received, the long connection established with the server is disconnected.

10. A resource exporting device, characterized in that: Applied to a server, the resource exporting device includes: The resource query unit is configured to: in response to a request for exporting resources sent by a client, perform a page query on a database storing the resources; The resource sending unit is configured to send the paging resources obtained by the paging query to the client in batches, so that the client can export the paging resources after splicing each batch received; Wherein, the resource sending unit is configured to: After each paging query is performed to obtain a batch of paging resources, a refresh method is called to send the obtained batch of paging resources to the client.

11. The resource exporting device according to claim 10, wherein: The invention also includes a connection establishing unit configured to: Before performing a paging query on a database storing the resource in response to a request for exporting the resource sent by the client, a persistent connection is established with the client, wherein the channel formed by the persistent connection is used to send the paging resource.

12. The resource exporting device according to claim 11, wherein: Also included is a connection closing unit configured to: After each batch of paging resources of the resource is completely sent, the long connection established with the client is disconnected.

13. An electronic device, characterized in that: include: at least one processor; at least one memory storing computer-executable instructions, When the computer executable instructions are executed by the at least one processor, the computer executable instructions cause the at least one processor to execute the resource export method according to any one of claims 1 to 3 or the resource export method according to any one of claims 4 to 6.

14. A computer-readable storage medium storing instructions, characterized in that: When the instructions are executed by at least one processor, the at least one processor is prompted to perform the resource export method according to any one of claims 1 to 3 or the resource export method according to any one of claims 4 to 6.

15. A computer program product comprising computer instructions, characterized in that When the computer instructions are executed by at least one processor, the resource export method according to any one of claims 1 to 3 or the resource export method according to any one of claims 4 to 6 is implemented.

Citation Information

Patent Citations

  • File stream processing method, file stream providing method, client and server

    CN109474563A

  • Data exporting method and device, terminal and readable storage medium

    CN113609168A