Data processing method, device, equipment and storage medium based on double buffer
By setting up double cache in the browser and data server, data editing, undoing and recovery functions are realized, which solves the problems of misoperation and performance loss in big data interaction in the browser/server architecture, and improves data processing efficiency and user experience.
Patent Information
- Application Number
- CN202410962144.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-18
AI Technical Summary
The existing browser/server architecture system lacks data undo and recovery functions in big data interaction scenarios, resulting in incorrect operations that cannot be restored, and repeated variable assignments causing performance losses.
Using a data processing method based on double cache, by setting the first cache and the second cache in the browser and data server, data editing, undoing and recovery operations can be realized, resource usage can be reduced, and work efficiency can be improved.
The data undo and recovery functions are implemented under the browser/server system architecture, reducing transmission performance loss in big data scenarios, improving data processing efficiency and user convenience.
Smart Images

Figure CN118503298B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a data processing method, device, equipment and storage medium based on double buffering. Background Art
[0002] During data operation, there are often misoperations that affect the change of global data, resulting in the inability to restore to a certain moment, or after data comparison, the data required is still the data before the modification. Therefore, during data operation, data memory (supporting data undo and data recovery operations) is particularly important.
[0003] At present, most browser / server-based architecture systems do not have undo and restore functions. Once the data on a page is modified, it is submitted to the backend for storage, so there is no way to perform undo and restore operations on the page. In addition, due to the limitations of the browser itself, the performance depends on its browser rendering engine. When interacting with the server, especially when interacting with big data, repeated variable assignments will cause a lot of performance loss.
[0004] Therefore, there is an urgent need for a data processing method to realize data memory in the big data interaction scenario of the browser / server architecture system. Summary of the invention
[0005] The present invention provides a data processing method, device, equipment and storage medium based on double buffering, which can realize data undo and restore operations, reduce resource occupation in the process of data interaction, and improve work efficiency.
[0006] According to one aspect of the present invention, a data processing method based on double buffering is provided, which is executed by a data server in a data operating system, wherein the data operating system also includes a browser; the browser is provided with a first buffering, and the data server is provided with a second buffering, wherein the first buffering and the second buffering store business data for generating a current page of the browser, and the method comprises:
[0007] In response to the data editing request sent by the browser, a corresponding editing operation is performed on the data to be operated in the second cache; wherein the data editing request includes an identifier of the data to be operated and an identifier of the data editing type;
[0008] In the case where the data server successfully executes the data editing request, a data processing function of the data editing type is generated in the second cache, and a message indicating that the data editing request is successfully executed is returned to the browser, so that the browser generates a data processing function of the data editing type in the first cache, wherein the data processing function includes a data undo function and a data restore function;
[0009] Data revocation or data recovery processing is performed based on the revocation and recovery request sent by the browser and the data processing functions in the first cache and the second cache.
[0010] According to another aspect of the present invention, a data processing method based on double buffering is provided, which is executed by a browser in a data operating system, and the data operating system also includes a data server; the browser is provided with a first buffer, and the data server is provided with a second buffer, and the first buffer and the second buffer store business data for generating a current page of the browser, and the method includes:
[0011] Sending a data editing request to a data server so that the data server performs a corresponding editing operation on the data to be operated in the second cache, generating a data processing function of the data editing type in the second cache when the data editing request is successfully executed, and returning a message indicating that the data editing request is successfully executed to the browser; the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; the data processing function includes a data undo function and a data restore function;
[0012] In response to a message indicating that the data editing request is successfully executed, generating a data processing function of the data editing type in the first cache;
[0013] A revocation and recovery request is sent to the data server, so that the data server performs data revocation or data recovery processing based on the data processing functions in the first cache and the second cache.
[0014] According to another aspect of the present invention, a data processing device based on double buffering is provided, which is applied to a data server in a data operating system, wherein the data operating system also includes a browser; the browser is provided with a first buffering, and the data server is provided with a second buffering, wherein the first buffering and the second buffering store business data for generating a current page of the browser, and the device includes:
[0015] An editing request execution module, configured to perform a corresponding editing operation on the data to be operated in the second cache in response to a data editing request sent by the browser; wherein the data editing request includes an identifier of the data to be operated and an identifier of the data editing type;
[0016] An editing success module, used for generating a data processing function of the data editing type in the second cache when the data server successfully executes the data editing request, and returning a message indicating that the data editing request is successfully executed to the browser, so that the browser generates a data processing function of the data editing type in the first cache, wherein the data processing function includes a data undo function and a data restore function;
[0017] The revocation and restoration request response module is used to perform data revocation or data restoration processing based on the revocation and restoration request sent by the browser and the data processing functions in the first cache and the second cache.
[0018] According to another aspect of the present invention, a data processing device based on double buffering is provided, which is applied to a browser in a data operating system, wherein the data operating system also includes a data server; the browser is provided with a first buffering, and the data server is provided with a second buffering, wherein the first buffering and the second buffering store business data for generating a current page of the browser, and the device includes:
[0019] An editing request sending module is used to send a data editing request to a data server so that the data server performs a corresponding editing operation on the data to be operated in the second cache. If the data editing request is successfully executed, a data processing function of the data editing type is generated in the second cache, and a message indicating that the data editing request is successfully executed is returned to the browser; the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; the data processing function includes a data undo function and a data restore function;
[0020] An edit request execution success module, configured to generate a data processing function of the data edit type in a first cache in response to a message indicating that the data edit request has been successfully executed;
[0021] The revocation and restoration request sending module is used to send a revocation and restoration request to the data server, so that the data server performs data revocation or data restoration processing based on the data processing functions in the first cache and the second cache.
[0022] According to another aspect of the present invention, there is provided an electronic device, the electronic device comprising:
[0023] at least one processor; and
[0024] a memory communicatively connected to the at least one processor; wherein,
[0025] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data processing method based on double buffering described in any embodiment of the present invention.
[0026] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method based on double buffering described in any embodiment of the present invention when executed.
[0027] The technical solution of the embodiment of the present invention is based on a first cache set in the browser and a second cache set in the data server for data processing. The browser does not need to obtain incremental data from the data server. The communication between the browser and the data server only involves instruction interaction and does not involve data transmission. In big data scenarios, the loss of transmission performance is reduced and the data processing efficiency is improved. In addition, by setting the data processing functions in the first cache and the second cache, data revocation and data recovery are realized in the browser / server system architecture, which brings great convenience to users in the process of data processing and improves work efficiency.
[0028] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0030] Figure 1a is an architecture diagram of a data operating system provided according to Embodiment 1 of the present invention;
[0031] Figure 1b is a flow chart of a data processing method based on double buffering provided according to the first embodiment of the present invention;
[0032] Figure 2 is a flow chart of a data processing method based on double buffering provided according to Embodiment 2 of the present invention;
[0033] Figure 3 is a flow chart of a data processing method based on double buffering provided according to Embodiment 3 of the present invention;
[0034] Figure 4 is a flow chart of a data processing method based on double buffering provided according to a fourth embodiment of the present invention;
[0035] Figure 5 is a schematic structural diagram of a data processing device based on double buffering provided according to Embodiment 5 of the present invention;
[0036] Figure 6 is a schematic diagram of the structure of a data processing device based on double buffering provided according to Embodiment 6 of the present invention;
[0037] Figure 7 The invention is a schematic structural diagram of an electronic device for implementing a data processing method based on double buffering according to an embodiment of the invention. DETAILED DESCRIPTION
[0038] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0039] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0040] Embodiment 1
[0041] Figure 1a This is a system architecture diagram of a data operating system provided in Embodiment 1 of the present invention. Figure 1a As shown, the data operating system includes a browser, a data server and a database; a first cache is set in the browser, and a second cache is set in the data server. The first cache and the second cache can store business data for generating the current page of the browser, and the database can be used to store all business data.
[0042] The browser may be used to initiate a data editing request to the data server, and the data server may be used to receive and respond to the data editing request sent by the browser, and execute the data editing operation corresponding to the data editing request.
[0043] Specifically, users can browse business pages of different businesses through browsers running on PCs or mobile devices, and can provide users with operation selections. Users can select business data that needs to be edited and the type of editing operation that needs to be performed on the browser. The browser can call different interfaces according to different editing operations selected by the user and send editing requests to the data server. The data server can be used to receive and respond to the data editing request sent by the browser, and edit the data to be operated indicated by the data editing request.
[0044] Optionally, the settings of the first cache and the second cache can be adaptively set according to technical personnel in this field. Exemplarily, the first cache can be a local database system (IndexedDB) provided in a Web browser, and the second cache can be a memory-level database. By setting the second cache as a buffer layer in the data service center, it is possible to avoid the data server directly operating on the business data in the database, avoid frequent read and write operations on the database, and improve work efficiency.
[0045] Figure 1b A flowchart of a data processing method based on double buffering is provided for the first embodiment of the present invention. This embodiment is applicable to the case where a data server processes business data. The method can be executed by a data processing device based on double buffering. The data processing device based on double buffering can be implemented in the form of hardware and / or software. The data processing device based on double buffering can be configured in various general-purpose computing devices, such as server devices. Figure 1b As shown, the method includes:
[0046] S110: In response to the data editing request sent by the browser, perform a corresponding editing operation on the data to be operated in the second cache.
[0047] The data editing request may include an identifier of the data to be operated and an identifier of the data editing type, which may be used to indicate a request to update or modify the data to be operated.
[0048] Optionally, the data to be operated may refer to the business data selected in the browser, and the data editing types include but are not limited to adding, updating, deleting, and merging. It should be noted that the data editing request may include multiple identifiers of the data to be operated, and multiple business data may be requested to be edited at the same time. Optionally, the business data may refer to cost calculation data, including cost calculation unit engineering data, user data, cost calculation data, and material data.
[0049] Specifically, the data server may perform an editing operation corresponding to the data editing type on the data to be operated in the second cache in response to the data editing request sent by the browser.
[0050] Optionally, when the user is editing business data in the input control of the browser, after the input control loses focus, the browser may generate a data editing request based on the data edited by the user and the data editing type and send it to the data server.
[0051] S120. When the data server successfully executes the data editing request, a data processing function of the data editing type is generated in the second cache, and a message indicating that the data editing request has been successfully executed is returned to the browser, so that the browser generates a data processing function of the data editing type in the first cache.
[0052] The data processing function may include a data undo function and a data restore function, which may be used to instruct the business data of the current page to return to the data state before the last editing operation.
[0053] Specifically, when the data server successfully executes the data editing request sent by the browser, the data server can generate a data processing function corresponding to the data editing type indicated by the data editing request in the second cache, and return a message to the browser indicating that the data editing request has been successfully executed, so that the browser can generate a data processing function of the data editing type in the first cache and display the edited data.
[0054] Optionally, when the data server fails to execute the data editing request, it will send a message of execution failure to the browser, so that the browser can resend the data editing request; if the browser repeatedly sends the data editing request and the number of times reaches the maximum number threshold, the browser will issue a data abnormality reminder to remind relevant maintenance personnel to intervene. Optionally, the maximum number threshold can be adaptively set according to those skilled in the art.
[0055] Optionally, if the data server is unable to receive the data editing request sent by the browser due to physical factors, such as no network connection, the browser will prompt the data server of a network abnormality, and when the data server network is no longer connected, the browser may save the generated data editing requests in the first cache in the chronological order of when the data editing requests were generated, and when the data server restores the network connection, the browser will send the data editing requests to the data server sequentially.
[0056] S130: Perform data revocation or data recovery processing based on the revocation and recovery request sent by the browser and the data processing functions in the first cache and the second cache.
[0057] The undo and restore request may include an undo operation request and a restore operation request, which are used to instruct to undo or restore the business data of the current page.
[0058] Specifically, in response to the undo / restore request sent by the browser, and based on the data processing function stored in the first cache in the browser and the second cache in the data server, data undo or data restore processing can be performed on the business data of the current page and the business data stored in the data service.
[0059] Optionally, if the data server fails to execute the undo-restore request, it will send an execution failure message to the browser so that the browser can resend the undo-restore request; if the browser repeatedly sends the undo-restore request and the number of times reaches a maximum threshold, the browser will issue an abnormal operation reminder to alert relevant maintenance personnel to intervene.
[0060] Optionally, in the embodiment of the present invention, the data server may also synchronize the business data stored in the second cache with the business data stored in the database in response to a page save instruction sent by the browser.
[0061] The page save instruction is used to instruct the browser to synchronize the business data status of the current page to the database.
[0062] Specifically, the data server may synchronize the data status of the business data of the current page to the database in response to the page saving instruction sent by the browser, so as to update the business data stored in the database.
[0063] The data server interacts with the database only after responding to the page save instruction, avoiding the need to access the database every time the data is edited, avoiding frequent read and write operations on the database, and improving the efficiency of data processing.
[0064] Optionally, in an embodiment of the present invention, the data processing method based on double buffering further includes: initializing a data operating system.
[0065] Specifically, before the browser displays the current page, the data server obtains the business data for generating the page that the browser currently needs to display from the database and stores it in the second cache, and sends the business data for the page that currently needs to be displayed to the browser, and the browser stores the business data for the page that currently needs to be displayed in the first cache; and the data server also obtains the historical data undo function and the historical data restore function from the undo stack and restore stack in the second cache and sends them to the browser. Optionally, the stack address size of the undo stack and the restore stack can be adaptively set according to those skilled in the art.
[0066] By initializing the data operating system, the data of the currently displayed page and the historical data undo function and historical data restore function are sent to the browser, so that the modified business data can be undone and restored when the browser page is closed and re-entered, thereby improving work efficiency.
[0067] The technical solution of the embodiment of the present invention is based on a first cache set in the browser and a second cache set in the data server for data processing. The browser does not need to obtain incremental data from the data server. The communication between the browser and the data server only involves instruction interaction and does not involve data transmission. In big data scenarios, the loss of transmission performance is reduced and the data processing efficiency is improved. In addition, by setting the data processing functions in the first cache and the second cache, data revocation and data recovery are realized in the browser / server system architecture, which brings great convenience to users in the process of data processing and improves work efficiency.
[0068] Embodiment 2
[0069] Figure 2 This is a flowchart of a data processing method based on double buffering provided in the second embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for generating a data processing function of the data editing type in the second buffer and returning a message to the browser that the data editing request has been successfully executed, so that the browser generates a data processing function of the data editing type in the first buffer. It should be noted that for the part not described in detail in the embodiment of the present invention, please refer to the relevant description of other embodiments, which will not be repeated here. Figure 2 As shown, the method includes:
[0070] S210: In response to the data editing request sent by the browser, perform a corresponding editing operation on the data to be operated in the second cache.
[0071] S220, generating a data processing function of a data editing type, storing the data processing function into a processing method pool in the second cache, and storing a data undo function in the data processing function into an undo stack in the second cache.
[0072] S230: Return a message indicating that the data editing request is successfully executed to the browser, so that the browser generates a data processing function of the data editing type, and stores the data undo function in the data processing function into an undo stack in the first cache.
[0073] S240: Perform data revocation or data recovery processing based on the revocation and recovery request sent by the browser and the data processing functions in the first cache and the second cache.
[0074] Among them, the processing method pool can be used to store data processing functions corresponding to data editing types.
[0075] In an embodiment of the present invention, if the data editing request sent by the browser is a data adding request, the data server responds to the data adding request, creates the new data in the second cache based on the identification of the data to be added, and returns a message of successful addition to the browser, so that the browser synchronously performs the adding operation to display the new data in the current page, and generates a data processing function of the data adding type, and stores the data undo function in the data processing function in the undo stack in the first cache. At the same time, after the data server completes the creation of the new data, it will generate a data processing function corresponding to the data adding type, and store it in the second cache, and store the data undo function in the data processing function in the undo stack in the second cache. Optionally, the identification of the data to be operated and the identification of the operating user can be added to the data processing function to provide data support for later responsibility tracing.
[0076] Optionally, in the case where the data editing request is a data adding request, if the newly added data needs to be inserted into the original business data sequence, the business data sequence after the insertion of the newly added data needs to be reordered.
[0077] If the data editing request sent by the browser is a data deletion request, the data server responds to the data deletion request, deletes the data to be deleted in the second cache based on the identifier of the data to be deleted, and returns a message of successful deletion to the browser, so that the browser synchronously performs the deletion operation to eliminate the data in the current page, and generates a data processing function of the data deletion type, and stores the data undo function in the data processing function in the undo stack in the first cache. At the same time, after deleting the data, the data server will generate a data processing function corresponding to the data deletion type, store it in the second cache, and store the data undo function in the data processing function in the undo stack in the second cache.
[0078] If the data editing request sent by the browser is a data update request, the data server responds to the data update request, updates the data to be updated in the second cache based on the identifier of the data to be updated, and returns a message of successful update to the browser, so that the browser synchronously performs the update operation to update the data to be updated in the current page, and generates a data processing function of the data update type, and stores the data undo function in the data processing function in the undo stack in the first cache. At the same time, after the data update is completed, the data server will generate a data processing function corresponding to the data update type, and store it in the second cache, and store the data undo function in the data processing function in the undo stack in the second cache. It should be noted that in the case where the data editing request is a data update request, the browser needs to send the value before the data update and the value after the data update to the data server together. After receiving the value after the data update, the data server can update the data to be updated, and record the value before the data update and the value after the data update in the data processing function corresponding to the data update type.
[0079] Optionally, in an embodiment of the present invention, if the browser receives and responds to a message indicating that a data editing instruction has been successfully executed, but fails to successfully complete the data editing operation corresponding to the data editing instruction on the client, the browser may send an undo / restore request to the data server to undo the data editing operation performed by the data server on the business data.
[0080] The technical solution of the embodiment of the present invention generates a data processing function corresponding to the data editing type, saves the data processing function in the first cache and the second cache in an instruction interactive manner, and dynamically maintains the data processing function based on the data editing request instruction, thereby realizing data undoing and data recovery functions under the browser / server system architecture, and improving the efficiency of data processing.
[0081] Embodiment 3
[0082] Figure 3 This is a flowchart of a data processing method based on double buffering provided in the third embodiment of the present invention. This embodiment further refines the above embodiment and provides specific steps for data revocation or data recovery based on the revocation and recovery request sent by the browser and the data processing functions in the first buffer and the second buffer. It should be noted that for the part not described in detail in the embodiment of the present invention, please refer to the relevant description of other embodiments, which will not be repeated here. Figure 3 As shown, the method includes:
[0083] S310: When the undo restore request is an undo operation request, in response to the undo operation request, take out a data undo function at the top of the undo stack from the second cache, and execute the data undo function at the top of the stack.
[0084] S320. When the data undo function at the top of the stack is executed successfully, a data recovery function of the same data editing type as the data undo function is determined from the processing method pool of the second cache, and stored in the recovery stack in the second cache, and an undo success instruction is sent to the browser, so that the browser takes out the data undo function at the top of the stack from the undo stack in the first cache and executes the data undo function at the top of the stack.
[0085] When the browser successfully executes the data undo function, the browser determines a data recovery function of the same data editing type as the data undo function from the first cache, and stores the function in a recovery stack in the first cache.
[0086] In an embodiment of the present invention, when the undo restore request sent by the browser to the data server is an undo operation request, the data server will take out the data undo function at the top of the undo stack in the second cache in response to the undo operation request, execute the data undo function taken out from the top of the undo stack, and return the business data in the data server to the data state before the last data editing operation; when the data server successfully executes the data undo function, the data server will determine the data recovery function of the same data editing type as the data undo function from the processing method pool of the second cache according to the identifier of the data to be operated in the data undo function and the identifier of the operating user, and store the data recovery function in the recovery stack of the second cache. At the same time, the data server will also send a successful undo instruction to the browser, so that the browser takes out the data undo function at the top of the undo stack in the first cache and executes the data undo function at the top of the stack, and when the browser successfully executes the data undo function, the browser will determine the data recovery function of the same data editing type as the data undo function from the first cache according to the identifier of the data to be operated in the data undo function and the identifier of the operating user, and store the data recovery function in the recovery stack of the first cache.
[0087] Optionally, in an embodiment of the present invention, after the data server successfully responds to and executes the undo operation request sent by the browser, if it receives a new data editing request sent by the browser, the data server and the browser will respectively clear the recovery stacks in the second cache and the first cache. For example, the data editing request indicates that the data to be operated is changed from 2 to 3, and then 3 is returned to 2 through the data undo function. At this time, the data operation indicated by the data recovery function at the top of the recovery stack is to restore 2 to 3. If the data editing request indicates that the data to be operated is changed from 2 to 4 at this time, the data status of the data to be operated is 2 instead of 3. Therefore, in order to avoid restoring the operation data to 3 through the data recovery function, the recovery stack needs to be cleared.
[0088] By maintaining the recovery stack, it is ensured that the data state of the data recovered by the data recovery function at the top of the recovery stack is always the last closest data state, thereby ensuring the accuracy of data processing.
[0089] Optionally, if the data server fails to successfully execute the data revocation function at the top of the revocation stack, the data server sends an abnormal operation warning to the browser, instructing relevant maintenance personnel to repair the data server.
[0090] Optionally, if the browser fails to successfully execute the data undo function at the top of the undo stack, the browser will send a recovery operation request to the data server to restore the business data in the second cache in the data server to the data state before executing the data undo function.
[0091] Optionally, in an embodiment of the present invention, it also includes: in a case where the undo recovery request is a recovery operation request, in response to the recovery operation request, taking out the data recovery function at the top of the stack from the recovery stack in the second cache, and executing the data recovery function at the top of the stack; in a case where the data recovery function at the top of the stack is executed successfully, determining a data undo function of the same data editing type as the data recovery function from the processing method pool of the second cache, storing it in the undo stack in the second cache, and sending a recovery success instruction to the browser, so that the browser takes out the data recovery function at the top of the stack from the recovery stack in the first cache, and executes the data recovery function at the top of the stack.
[0092] When the browser executes the data recovery function successfully, the browser determines a data undo function of the same data editing type as the data recovery function from the first cache, and stores the function in an undo stack in the first cache.
[0093] Specifically, when the undo restore request sent by the browser to the data server is a restore operation request, the data server will take out the data restore function at the top of the restore stack in the second cache in response to the restore operation request, execute the data restore function taken out from the top of the undo stack, and return the business data in the data server to the data state before the last data editing operation; when the data server successfully executes the data restore function, the data server will determine the data undo function of the same data editing type as the data restore function from the processing method pool of the second cache according to the identifier of the data to be operated and the identifier of the operating user in the data restore function, and store the data undo function in the undo stack of the second cache. At the same time, the data server will also send a restore success instruction to the browser, so that the browser takes out the data restore function at the top of the restore stack in the first cache and executes the data restore function at the top of the stack, and when the browser successfully executes the data restore function, the browser will determine the data undo function of the same data editing type as the data restore function from the first cache according to the identifier of the data to be operated and the identifier of the operating user in the data restore function, and store the data undo function in the undo stack of the first cache.
[0094] Optionally, if the data server fails to successfully execute the data recovery function at the top of the recovery stack, the data server sends an abnormal operation warning to the browser, instructing relevant maintenance personnel to repair the data server.
[0095] Optionally, if the browser fails to successfully execute the data recovery function at the top of the undo stack, the browser will send a recovery and undo request to the data server to restore the business data in the second cache in the data server to the data state before executing the data recovery function.
[0096] The technical solution of the embodiment of the present invention calls the data undo function and data recovery function in the first cache and the second cache through the undo and restore request sent by the browser and the execution status of the undo and restore request returned by the data browser, thereby realizing data undo and data recovery under the browser / server system architecture, bringing great convenience to users in the process of data processing and improving work efficiency.
[0097] Embodiment 4
[0098] Figure 4A flowchart of a data processing method based on double buffering is provided for the fourth embodiment of the present invention. This embodiment is applicable to the case where a browser sends a data operation request to a data server to process business data. The method can be executed by a data processing device based on double buffering. The data processing device based on double buffering can be implemented in the form of hardware and / or software. The data processing device based on double buffering can be configured in various general computing devices, such as mobile phone terminals, tablet computers or desktop computers. Figure 4 As shown, the method includes:
[0099] S410. Send a data editing request to the data server so that the data server performs corresponding editing operations on the data to be operated in the second cache. If the data editing request is successfully executed, a data processing function of the data editing type is generated in the second cache, and a message indicating that the data editing request is successfully executed is returned to the browser.
[0100] S420. In response to a message indicating that the data editing request is successfully executed, generate a data processing function of the data editing type in the first cache.
[0101] S430: Send a revocation and restoration request to the data server, so that the data server performs data revocation or data restoration processing based on the data processing functions in the first cache and the second cache.
[0102] Among them, the data editing request may include the identification of the data to be operated and the identification of the data editing type, which can be used to indicate a request to update and modify the data to be operated; the data processing function may include a data undo function and a data restore function, which can be used to indicate that the business data of the current page returns to the data state before the last editing operation; the undo and restore request may include an undo operation request and a restore operation request, which are used to indicate the undo or restore processing of the business data of the current page.
[0103] In an embodiment of the present invention, a browser may send a data editing request to a data server, so that the data server performs an editing operation corresponding to the data editing type on the data to be operated in the second cache; when the data server successfully executes the data editing request sent by the browser, the data server may generate a data processing function corresponding to the data editing type indicated by the data editing request in the second cache, and return a message to the browser indicating that the data editing request has been successfully executed; in response to the message indicating that the data editing request has been successfully executed, the browser may generate a data processing function of the data editing type in the first cache, and display the edited data; the browser may also send an undo / restore request to the data server, so that the data server performs data undo or data recovery processing on the business data of the current page and the business data stored in the data service based on the data processing functions stored in the first cache in the browser and the second cache in the data server.
[0104] The technical solution of the embodiment of the present invention is based on a first cache set in the browser and a second cache set in the data server for data processing. The browser does not need to obtain incremental data from the data server. The communication between the browser and the data server only involves instruction interaction and does not involve data transmission. In big data scenarios, the loss of transmission performance is reduced and the data processing efficiency is improved. In addition, by setting the data processing functions in the first cache and the second cache, data revocation and data recovery are realized in the browser / server system architecture, which brings great convenience to users in the process of data processing and improves work efficiency.
[0105] Embodiment 5
[0106] Figure 5 The structure diagram of a data processing device based on double buffering provided in the fifth embodiment of the present invention. The device is applied to a data server in a data operating system, and the data operating system also includes a browser; the browser is provided with a first buffering, and the data server is provided with a second buffering, and the first buffering and the second buffering store the business data for generating the current page of the browser. Figure 5 As shown, the device comprises:
[0107] The editing request execution module 510 is used to perform a corresponding editing operation on the data to be operated in the second cache in response to the data editing request sent by the browser; wherein the data editing request includes an identifier of the data to be operated and an identifier of the data editing type;
[0108] The editing success module 520 is used to generate a data processing function of the data editing type in the second cache when the data server successfully executes the data editing request, and return a message that the data editing request is successfully executed to the browser, so that the browser generates a data processing function of the data editing type in the first cache, and the data processing function includes a data undo function and a data restore function;
[0109] The revocation and restoration request response module 530 is used to perform data revocation or data restoration processing based on the revocation and restoration request sent by the browser and the data processing functions in the first cache and the second cache.
[0110] The technical solution of the embodiment of the present invention is based on a first cache set in the browser and a second cache set in the data server for data processing. The browser does not need to obtain incremental data from the data server. The communication between the browser and the data server only involves instruction interaction and does not involve data transmission. In big data scenarios, the loss of transmission performance is reduced and the data processing efficiency is improved. In addition, by setting the data processing functions in the first cache and the second cache, data revocation and data recovery are realized in the browser / server system architecture, which brings great convenience to users in the process of data processing and improves work efficiency.
[0111] Optionally, the editing success module 520 includes:
[0112] A data processing function generating unit, used for generating a data processing function of a data editing type, storing the data processing function into a processing method pool in the second cache, and storing a data undo function in the data processing function into an undo stack in the second cache; the processing method pool is used for storing data processing functions corresponding to the data editing type;
[0113] The editing request execution success unit is used to return a message indicating that the data editing request has been successfully executed to the browser, so that the browser generates a data processing function of the data editing type and stores the data undo function in the data processing function into the undo stack in the first cache.
[0114] Optionally, the revocation and restoration request response module 530 includes:
[0115] a revocation unit, configured to, when the revocation recovery request is a revocation operation request, retrieve a data revocation function at the top of the stack from the revocation stack in the second cache in response to the revocation operation request, and execute the data revocation function at the top of the stack;
[0116] The undo success unit is used to determine, when the data undo function is successfully executed, a data recovery function of the same data editing type as the data undo function from the processing method pool of the second cache, and store it in the recovery stack in the second cache, and send a undo success instruction to the browser so that the browser takes out the top data undo function from the undo stack in the first cache and executes the top data undo function; wherein, when the browser executes the data undo function successfully, the browser determines, from the first cache, a data recovery function of the same data editing type as the data undo function, and stores it in the recovery stack in the first cache.
[0117] Optionally, the revocation and restoration request response module 530 further includes:
[0118] a recovery unit, configured to, in the case where the cancel recovery request is a recovery operation request, retrieve a data recovery function at the top of the stack from the recovery stack in the second cache in response to the recovery operation request, and execute the data recovery function at the top of the stack;
[0119] A recovery success unit is used to determine, when the data recovery function at the top of the stack is executed successfully, a data undo function of the same data editing type as the data recovery function from the processing method pool of the second cache, and store it in the undo stack in the second cache, and send a recovery success instruction to the browser so that the browser takes out the data recovery function at the top of the stack from the recovery stack in the first cache and executes the data recovery function at the top of the stack; wherein, when the browser executes the data recovery function successfully, the browser determines, from the first cache, a data undo function of the same data editing type as the data recovery function, and stores it in the undo stack in the first cache.
[0120] The data processing device based on double buffering provided in the embodiment of the present invention can execute the data processing method based on double buffering provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0121] Embodiment 6
[0122] Figure 6 A schematic diagram of the structure of a data processing device based on double buffering provided in the sixth embodiment of the present invention. The device is applied to a browser in a data operating system, and the data operating system also includes a data server; the browser is provided with a first buffer, and the data server is provided with a second buffer, and the first buffer and the second buffer store business data for generating the current page of the browser. Figure 6 As shown, the device comprises:
[0123] The editing request sending module 610 is used to send a data editing request to the data server so that the data server performs a corresponding editing operation on the data to be operated in the second cache. If the data editing request is successfully executed, a data processing function of the data editing type is generated in the second cache, and a message of successful execution of the data editing request is returned to the browser; the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; the data processing function includes a data undo function and a data restore function;
[0124] An edit request execution success module 620 is used to generate a data processing function of a data edit type in a first cache in response to a message that a data edit request is executed successfully;
[0125] The revocation and restoration request sending module 630 is used to send a revocation and restoration request to the data server, so that the data server performs data revocation or data restoration processing based on the data processing functions in the first cache and the second cache.
[0126] The technical solution of the embodiment of the present invention is based on a first cache set in the browser and a second cache set in the data server for data processing. The browser does not need to obtain incremental data from the data server. The communication between the browser and the data server only involves instruction interaction and does not involve data transmission. In big data scenarios, the loss of transmission performance is reduced and the data processing efficiency is improved. In addition, by setting the data processing functions in the first cache and the second cache, data revocation and data recovery are realized in the browser / server system architecture, which brings great convenience to users in the process of data processing and improves work efficiency.
[0127] The data processing device based on double buffering provided in the embodiment of the present invention can execute the data processing method based on double buffering provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0128] Embodiment 7
[0129] Figure 7 A schematic diagram of an electronic device 710 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0130] like Figure 7 As shown, the electronic device 710 includes at least one processor 711, and a memory connected to the at least one processor 711 in communication, such as a read-only memory (ROM) 712, a random access memory (RAM) 713, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 711 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 712 or the computer program loaded from the storage unit 718 to the random access memory (RAM) 713. In the RAM 713, various programs and data required for the operation of the electronic device 710 can also be stored. The processor 711, the ROM 712, and the RAM 713 are connected to each other via a bus 714. An input / output (I / O) interface 715 is also connected to the bus 714.
[0131] A number of components in the electronic device 710 are connected to the I / O interface 715, including: an input unit 716, such as a keyboard, a mouse, etc.; an output unit 717, such as various types of displays, speakers, etc.; a storage unit 718, such as a disk, an optical disk, etc.; and a communication unit 719, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 719 allows the electronic device 710 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0132] The processor 711 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 711 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 711 performs the various methods and processes described above, such as a data processing method based on double buffering.
[0133] In some embodiments, the data processing method based on double buffering can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 718. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 710 via the ROM 712 and / or the communication unit 719. When the computer program is loaded into the RAM 713 and executed by the processor 711, one or more steps of the data processing method based on double buffering described above can be performed. Alternatively, in other embodiments, the processor 711 can be configured to perform the data processing method based on double buffering in any other appropriate manner (for example, by means of firmware).
[0134] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0135] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0136] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0137] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0138] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0139] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0140] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0141] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data processing method based on double buffering, characterized in that: The method is executed by a data server in a data operating system, wherein the data operating system further comprises a browser; the browser is provided with a first cache, and the data server is provided with a second cache, wherein the first cache and the second cache store business data for generating a current page of the browser, and the method comprises: In response to the data editing request sent by the browser, a corresponding editing operation is performed on the data to be operated in the second cache; wherein the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; In the case where the data server successfully executes the data editing request, a data processing function of the data editing type is generated in the second cache, and a message indicating that the data editing request is successfully executed is returned to the browser, so that the browser synchronously performs the editing operation corresponding to the data editing request, and a data processing function of the data editing type is generated in the first cache; the data processing function includes a data undo function and a data restore function; Data revocation or data recovery processing is performed based on the revocation and recovery request sent by the browser and the data processing functions in the first cache and the second cache.
2. The method according to claim 1, characterized in that Generating a data processing function of the data editing type in the second cache, and returning a message indicating that the data editing request is successfully executed to the browser so that the browser synchronously performs an editing operation corresponding to the data editing request, and generating a data processing function of the data editing type in the first cache, including: Generate a data processing function of the data editing type, store the data processing function in a processing method pool in a second cache, and store a data undo function in the data processing function in an undo stack in the second cache; the processing method pool is used to store data processing functions corresponding to the data editing type; A message indicating that the data editing request has been successfully executed is returned to the browser, so that the browser generates a data processing function of the data editing type, stores the data undo function in the data processing function into the undo stack in the first cache, and synchronously performs the editing operation corresponding to the data editing request and displays the edited data.
3. The method according to claim 1, characterized in that Based on the undo and restore request sent by the browser and the data processing functions in the first cache and the second cache, data undo or data restore processing is performed, including: In the case where the undo restore request is an undo operation request, in response to the undo operation request, taking out a data undo function at the top of the undo stack from the second cache, and executing the data undo function at the top of the stack; In the case where the data undo function is executed successfully, determining a data recovery function of the same data editing type as that of the data undo function from the processing method pool of the second cache, storing the function in a recovery stack in the second cache, and sending a successful undo instruction to the browser, so that the browser takes out the data undo function at the top of the undo stack from the first cache and executes the data undo function at the top of the stack; When the browser executes the data undo function successfully, the browser determines a data recovery function of the same data editing type as the data undo function from the first cache, and stores the function in a recovery stack in the first cache.
4. The method according to claim 1, characterized in that Based on the undo and restore request sent by the browser and the data processing functions in the first cache and the second cache, data undo or data restore processing is performed, further comprising: In a case where the undo restore request is a restore operation request, in response to the restore operation request, taking out a data restore function at the top of the stack from the restore stack in the second cache, and executing the data restore function at the top of the stack; In the case where the data recovery function at the top of the stack is executed successfully, a data undo function of the same data editing type as that of the data recovery function is determined from the processing method pool of the second cache, and stored in the undo stack in the second cache, and a recovery success instruction is sent to the browser, so that the browser takes out the data recovery function at the top of the stack from the recovery stack in the first cache and executes the data recovery function at the top of the stack; When the browser executes the data recovery function successfully, the browser determines a data undo function of the same data editing type as the data recovery function from the first cache, and stores the function in an undo stack in the first cache.
5. The method according to claim 1, characterized in that The data operating system also includes a database; The method further comprises: The data operating system is initialized before the browser displays the current page; wherein the initialization process includes: the data server obtains the business data for generating the current page of the browser from the database and stores it in the second cache, and synchronously sends the business data of the current page to the browser, and the data server obtains the historical data undo function in the undo stack in the second cache and the historical data restore function in the restore stack and sends them to the browser.
6. A data processing method based on double buffering, characterized in that: The method is executed by a browser in a data operating system, the data operating system also includes a data server; the browser is provided with a first cache, the data server is provided with a second cache, the first cache and the second cache store business data for generating a current page of the browser, and the method includes: Sending a data editing request to a data server so that the data server performs a corresponding editing operation on the data to be operated in the second cache, generating a data processing function of the data editing type in the second cache when the data editing request is successfully executed, and returning a message indicating that the data editing request is successfully executed to the browser; the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; the data processing function includes a data undo function and a data restore function; In response to a message indicating that the data editing request is successfully executed, synchronously performing an editing operation corresponding to the data editing request, and generating a data processing function of the data editing type in a first cache; A revocation and recovery request is sent to the data server, so that the data server performs data revocation or data recovery processing based on the data processing functions in the first cache and the second cache.
7. A data processing device based on double buffering, characterized in that: A data server applied to a data operating system, the data operating system also includes a browser; the browser is provided with a first cache, the data server is provided with a second cache, the first cache and the second cache store business data for generating a current page of the browser, the device includes: An editing request execution module, configured to perform a corresponding editing operation on the data to be operated in the second cache in response to a data editing request sent by the browser; wherein the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; An editing success module, used for generating a data processing function of the data editing type in the second cache when the data server successfully executes the data editing request, and returning a message of successful execution of the data editing request to the browser so that the browser synchronously performs the editing operation corresponding to the data editing request, and generating a data processing function of the data editing type in the first cache, wherein the data processing function includes a data undo function and a data restore function; The revocation and restoration request response module is used to perform data revocation or data restoration processing based on the revocation and restoration request sent by the browser and the data processing functions in the first cache and the second cache.
8. A data processing device based on double buffering, characterized in that: A browser applied to a data operating system, the data operating system also including a data server; the browser is provided with a first cache, the data server is provided with a second cache, the first cache and the second cache store business data for generating a current page of the browser, the device comprising: An editing request sending module is used to send a data editing request to a data server so that the data server performs a corresponding editing operation on the data to be operated in the second cache. If the data editing request is successfully executed, a data processing function of the data editing type is generated in the second cache, and a message indicating that the data editing request is successfully executed is returned to the browser; the data editing request includes an identifier of the data to be operated and an identifier of the data editing type; the data processing function includes a data undo function and a data restore function; An edit request execution success module, used to respond to a message indicating that a data edit request has been successfully executed, synchronously perform an edit operation corresponding to the data edit request, and generate a data processing function of the data edit type in a first cache; The revocation and restoration request sending module is used to send a revocation and restoration request to the data server, so that the data server performs data revocation or data restoration processing based on the data processing functions in the first cache and the second cache.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data processing method based on double buffering according to any one of claims 1 to 5 or claim 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the data processing method based on double buffering according to any one of claims 1 to 5 or claim 6 when executed.
