Data storage method and apparatus

CN115309381BActive Publication Date: 2026-08-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110490992.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-05-06
Publication Date
2026-08-21
Estimated Expiration
2041-05-06

AI Technical Summary

Technical Problem

[0004]本发明实施例提供了一种数据存储方法和装置,以至少解决应用程序开发平台操作历史易丢失,不能长期存储的技术问题

Benefits of technology

[0008]根据本发明实施例的又一方面,还提供了一种电子设备,包括存储器和处理器,上述存储器中存储有计算机程序,上述处理器被设置为通过所述计算机程序执行上述的数据存储方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309381B_ABST
    Figure CN115309381B_ABST
Patent Text Reader

Abstract

The application discloses a data storage method and device. The method comprises the following steps: displaying a code online editing interface in a visual development page of an application development platform; in the case that it is detected that code data in the code online editing interface is edited, analyzing a visual data structure of the visual development page, and converting page data in the visual development page into first format data; converting current operation code data obtained through the code online editing interface into attribute data of the visual development page; fusing the attribute data and the first format data corresponding to the visual development page according to the visual data structure, so as to obtain a page data packet matched with the visual development page; and storing the page data packet into a database through a storage thread of the application development platform. The application solves the technical problem that operation history of the application development platform is easy to be lost and cannot be stored for a long time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computers, and more specifically, to a data storage method and apparatus. Background Technology

[0002] As enterprises deepen their digital transformation, more and more companies are shifting from traditional pure coding development methods to using more efficient development platforms to develop application software. However, when using efficient low-code rapid development platforms and other tools for application software development, a common issue is the loss of operation history when refreshing or closing the browser, leading to the problem of persistent storage of operation history. Furthermore, storing the current page or performing synchronization operations consumes significant system memory, affecting other operations on the application development platform and causing page lag.

[0003] There is currently no effective solution to the above problems. Summary of the Invention

[0004] This invention provides a data storage method and apparatus to at least solve the technical problem that the operation history of application development platforms is easily lost and cannot be stored for a long time.

[0005] According to one aspect of the present invention, a data storage method is provided, comprising: displaying an online code editing interface on a visual development page of an application development platform; upon detecting an editing change in the code data in the online code editing interface, parsing the visual data structure of the visual development page and converting the page data in the visual development page into first format data, wherein the visual data structure is used to record the data structure between the various page components included in the visual development page; converting the current operation code data obtained through the online code editing interface into attribute data of the visual development page; fusing the attribute data with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data package matching the visual development page; and storing the page data package in the database of the application development platform through a storage thread of the application development platform.

[0006] According to another aspect of the present invention, a data storage device is also provided, comprising: a display unit for displaying an online code editing interface on a visual development page of an application development platform; a parsing unit for parsing a visual data structure of the visual development page and converting page data in the visual development page into first format data when an edit change is detected in the code data in the online code editing interface, wherein the visual data structure is used to record the data structure between various page components included in the visual development page; a conversion unit for converting the current operation code data obtained through the online code editing interface into attribute data of the visual development page; a fusion unit for fusing the attribute data with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data packet matching the visual development page; and a storage unit for storing the page data packet in the database of the application development platform through a storage thread of the application development platform.

[0007] According to another aspect of the present invention, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described data storage method at runtime.

[0008] According to another aspect of the present invention, an electronic device is also provided, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to execute the above-described data storage method through the computer program.

[0009] In this embodiment of the invention, an online code editing interface is displayed on a visual development page of an application development platform. When a change in code data is detected in the online code editing interface, the visual data structure of the visual development page is parsed, and the page data in the visual development page is converted into first format data. The visual data structure records the data structure between various page components included in the visual development page. The currently operating code data obtained through the online code editing interface is converted into attribute data of the visual development page. The attribute data is then fused with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data package matching the visual development page. This is then implemented through the application... The storage thread of the application development platform stores the page data package in the database of the application development platform by converting the acquired current operation code data into attribute data of the visual development page; according to the visual data structure, the attribute data is fused with the first format data corresponding to the visual development page to obtain the page data package matching the visual development page; by storing the page data package in the database of the application development platform through the storage thread of the application development platform, the purpose of persistent storage of operation history during the application development process is achieved, thereby realizing the technical effects of persistent storage of operation history during the application development process, reducing system memory usage and improving application development efficiency, and thus solving the technical problem that the operation history of the application development platform is easily lost and cannot be stored for a long time. Attached Figure Description

[0010] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0011] Figure 1 This is a schematic diagram of an application environment for an optional data storage method according to an embodiment of the present invention;

[0012] Figure 2 This is a schematic diagram of an application environment for another optional data storage method according to an embodiment of the present invention;

[0013] Figure 3 This is a flowchart of an optional data storage method according to an embodiment of the present invention;

[0014] Figure 4 This is a schematic diagram of a visual page history operation interface for an optional data storage method according to an embodiment of the present invention;

[0015] Figure 5This is a schematic diagram of the data structure of a development and application description model for an optional data storage method according to an embodiment of the present invention.

[0016] Figure 6 This is a schematic diagram of a low-code content history operation interface for an optional data storage method according to an embodiment of the present invention.

[0017] Figure 7 This is a schematic diagram of the data structure interface for page storage in another optional data storage method according to an embodiment of the present invention;

[0018] Figure 8 This is a flowchart of an optional data storage method according to an embodiment of the present invention;

[0019] Figure 9 This is a flowchart of another optional data storage method according to an embodiment of the present invention;

[0020] Figure 10 This is a flowchart of another optional data storage method according to an embodiment of the present invention;

[0021] Figure 11 This is a schematic diagram of the structure of an optional data storage device according to an embodiment of the present invention;

[0022] Figure 12 This is a schematic diagram of the structure of an optional electronic device according to an embodiment of the present invention. Detailed Implementation

[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0025] According to one aspect of the present invention, a data storage method is provided. Optionally, as an alternative implementation, the above-described data storage method may be applied to, but is not limited to, [examples of other methods]. Figure 1 The environment shown includes: a terminal device 102 for human-computer interaction, a network 104, and a server 106. User 108 can interact with terminal device 102, which runs a data storage application client. Terminal device 102 includes a human-computer interaction screen 1022, a processor 1024, and a memory 1026. The human-computer interaction screen 1022 is used to present code data from the online code editing interface and attribute data from the visual development page. The processor 1024, upon detecting changes in the code data from the online code editing interface, parses the visual data structure of the visual development page and converts the page data in the visual development page into first-format data; it converts the current operation code data obtained through the online code editing interface into attribute data for the visual development page; it merges the attribute data with the first-format data corresponding to the visual development page according to the visual data structure to obtain a page data packet matching the visual development page; and it stores the page data packet in the database of the application development platform through the storage thread of the application development platform. The memory 1026 is used to store code data in the online code editing interface, and also to store attribute data of the visual development page.

[0026] Furthermore, server 106 includes database 1062 and processing engine 1064. Database 1062 stores page data packet information matching the visualization development page, obtained by fusing attribute data with the first format data corresponding to the visualization development page according to the visualization data structure. Processing engine 1064 is used to send the aforementioned page data packet information through network 104 after receiving a sending instruction for the aforementioned page data packet information.

[0027] The specific process is as follows: assuming... Figure 1The terminal device 102 shown runs a data storage application client. User 108 operates the human-computer interaction screen 1022 to operate the data storage application client, as in steps S102-S110. An online code editing interface is displayed on the visual development page of the application development platform. When a change in the code data in the online code editing interface is detected, the visual data structure of the visual development page is parsed, and the page data in the visual development page is converted into first format data. The visual data structure records the data structure between the various page components included in the visual development page. The currently operated code data obtained through the online code editing interface is converted into attribute data for the visual development page. The attribute data is fused with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data packet matching the visual development page. The page data packet is stored in the database of the application development platform through the storage thread. Then, step S112 is executed, and the page data packet is sent to the server 106 via network 104. After the database 1062 in server 106 stores the page data packet... As in step S114, the terminal device 102 is notified via network 104 to return to the visual development page.

[0028] As another optional implementation, the data storage method described above in this application can be applied to... Figure 2 The application environment shown. For example... Figure 2 As shown, user 202 and user device 204 can interact with each other. User device 204 includes memory 206 and processor 208. In this embodiment, user device 204 can, but is not limited to, referencing and executing the operations performed by terminal device 102 to obtain page data packet information.

[0029] Optionally, the terminal devices 102 and 204 may be, but are not limited to, mobile phones, tablets, laptops, PCs, etc., and the network 104 may be, but is not limited to, a wireless network or a wired network. The wireless network includes Wi-Fi and other networks that enable wireless communication. The wired network may include, but is not limited to, wide area networks (WANs), metropolitan area networks (MANs), and local area networks (LANs). The server 106 may be, but is not limited to, any hardware device capable of computation.

[0030] Alternatively, as an alternative implementation method, such as Figure 3 As shown, the above data storage method includes:

[0031] S302 displays the online code editing interface in the visual development page of the application development platform;

[0032] S304, when it is detected that the code data in the above-mentioned online code editing interface has been edited, the visualization data structure of the above-mentioned visual development page is parsed, and the page data in the above-mentioned visual development page is converted into first format data, wherein the above-mentioned visualization data structure is used to record the data structure between the various page components included in the above-mentioned visual development page.

[0033] S306, convert the current operation code data obtained through the above online code editing interface into the attribute data of the above visual development page;

[0034] S308, Based on the above-mentioned visualization data structure, the above-mentioned attribute data and the above-mentioned first format data corresponding to the above-mentioned visualization development page are merged to obtain the page data package matching the above-mentioned visualization development page.

[0035] S310, the page data packet is stored in the database of the application development platform through the storage thread of the application development platform.

[0036] In step S302, in practical applications, the application development platform may include, but is not limited to, various visual application development platforms, or various application development platforms that can be dragged and dropped for editing and programming, etc., and is not limited here.

[0037] In step S304, in practical application, when a change in code data is detected in the online code editing interface, the visual data structure of the visual development page is parsed. That is, for example, when the backend server in the application development platform detects a change in the encoded code, it parses the visual data structure of the visual development page to obtain the parsing result. For instance, if the content of the web container component on the current page is changed from state A to state B, the parsing result can be recorded as the current position of the web container and the process of the content within the container changing from A to B. The above is merely an example, and this embodiment does not impose any limitations. In this embodiment, the aforementioned first format data can be XML format data, JSON format data, or YAML format data. No limitations are imposed here.

[0038] In step S306, in practical application, the current operation code data obtained through the online code editing interface is converted into attribute data of the visual development page; that is, the operation code corresponding to the visual page is converted into attribute data corresponding to the visual development page. In this embodiment, the application is developed by combining the visual operation interface and code editing. Here, the attribute data may include the status information and parameter information of the visual development control, etc., which are not limited here.

[0039] In step S308, in practical application, the attribute data is fused with the first format data corresponding to the visual development page according to the visual data structure to obtain the page data package matching the visual development page; that is, according to the visual data structure and the different types of data corresponding to the data structure, the first format data corresponding to the page data in the visual development page is fused to obtain the corresponding page data package. The page data package includes the first format data and multiple pages of the visual development page and the parameter information in the pages. That is, the page data package contains the above two parts. The above page data package is stored in the directory of the database for persistent storage.

[0040] In step S310, in practical applications, the storage thread of the application development platform can be used to store and retrieve data using webwork worker threads. This avoids occupying the main thread of the user platform for display and other operations, increasing platform smoothness and providing a better user experience. In this embodiment of the invention, the webwork worker process can run background programs written by developers that can run for extended periods without user interruption, executing transactions or logic while ensuring page responsiveness. The database in this application example can include, but is not limited to, large-capacity local storage databases on the web side such as IndexedDB and WebSQL, facilitating data retrieval; the aforementioned database can also be a server-side database or a cloud database, etc., without any limitations.

[0041] In embodiments of the present invention, such as Figure 4 As shown, an online code editing interface is displayed on the visual development page of the application development platform. When a change in the code data in the online code editing interface 400 is detected, such as a change in the component or page configuration operation information in the page editing module 402, a change in the path parameter in the LOWCODE file of the key sub-Key in the code display module 404, or a change in the code in the key value corresponding to the keyword Key, the visual data structure of the visual development page is parsed. That is, the content of the data, style, or event contained in the page or component in the visual development page, such as the component data, style, or event contained in the page editing interface 404, is parsed, as well as the code data in the online code editing interface 402. The content of the data, style, or event contained in the component in the page editing interface 404 is converted into first format data, such as storing the content of the data, style, or event contained in the component in the page editing interface 404, as well as the component type and component ID, in an XML format document. The current operation code data obtained through the online code editing interface is converted into the attribute data of the visual development page, such as... Figure 5As shown, the aforementioned attribute data includes, but is not limited to, id under different development pages, the list of page component description model data structures (Componentinstances, data); based on the aforementioned visualization data structure, the aforementioned attribute data is matched with the aforementioned first format data corresponding to the aforementioned visualization development page (e.g., Figure 5 The low-code files in the image are merged to obtain the page data package that matches the above-mentioned visual development page. This page data package includes, but is not limited to, files such as... Figure 5 The page data structure file in the application development platform; through the storage thread (such as the WebWork storage thread) of the application development platform, the page data package is stored in the database (such as the application development platform's database). Figure 4 The database IndexedDb).

[0042] By converting the current operation code data obtained through the online code editing interface into attribute data for the visual development page; and by fusing the attribute data with the first format data corresponding to the visual development page according to the visual data structure, a page data package matching the visual development page is obtained; and by storing the page data package in the database of the application development platform through the storage thread, the goal of persistent storage of operation history during application development is achieved. This achieves the technical effects of persistent storage of operation history in application development, reducing system memory usage, and improving application development efficiency, thereby solving the technical problem that operation history in application development platforms is easily lost and cannot be stored for a long time.

[0043] In one embodiment, step S310 includes: sending the page data packet to the storage thread, wherein the storage thread is a sub-thread configured for the main development thread of the application development platform; generating a storage index for the page data packet through the storage thread, and storing the storage index and the corresponding page data packet in the database, wherein the storage index is used to uniquely identify the page data packet. In this embodiment, different storage threads can be used to store page data corresponding to sub-threads configured under different main development threads. A key-value data storage mode can be generated for the page data through the storage thread. Here, the key can be the key value corresponding to the storage thread, and the value can be the page data packet corresponding to the storage thread.

[0044] In one embodiment, the process of generating a storage index for the page data packet using the storage thread and storing the storage index and the corresponding page data packet in the local storage database includes: reading historical operation code data from the database; comparing the historical operation code data with the current operation code data in the attribute data using the storage thread; discarding the current operation code data if the historical operation code data and the current operation code data are the same; generating a first storage index for the first format data in the page data packet and generating a second storage index for the attribute data in the page data packet if the historical operation code data and the current operation code data are different; storing the first format data and the first storage index in the database at a first address, and storing the attribute data and the second storage index in the database at a second address.

[0045] In this embodiment, after reading historical operation code data from the local database, the differences between the historical operation code data and the current operation code data are compared. If the current operation code data is the same as the historical operation code data, only the historical operation code data is retained. If the current operation code data is different from the historical operation code data, the first format data is stored in a different location in the database than the attribute data.

[0046] In one embodiment, storing the attribute data and the second storage index in the database at the second address includes: determining the current historical pointer of the historical operation code data in the database; and incrementing the current historical pointer by 1 to obtain the address pointer corresponding to the second address. In this embodiment, the target address corresponding to the current operation data can be updated by changing the current historical pointer.

[0047] In one embodiment, after generating a first storage index for the first format data in the page data packet and a second storage index for the attribute data in the page data packet, the method further includes: incrementing the number of entries in the historical page data packets already stored in the database to obtain an updated number of entries; if the updated number of entries has not yet reached the maximum number of entries stored in the database, determining to store the first format data and the first storage index in a first address in the database, and storing the attribute data and the second storage index in a second address in the database. In this embodiment, the maximum number of entries in the page data packet can be set according to the size of the database storage capacity. When the updated number of entries has not reached the maximum number of entries stored in the local data, the current first format data and the attribute data can be stored.

[0048] In one embodiment, the process of generating a storage index for the page data packet using the storage thread and storing the storage index and the corresponding page data packet in the database includes: when the edit change indicator in the online code editing interface indicates an undo change, determining the first address pointer corresponding to the currently modified code data that was undone in the attribute data; storing the currently modified code data in the local storage database; and decrementing the first address pointer by one. Through these technical means, data undo operations can be implemented in the application development platform, improving the efficiency of application development.

[0049] In one embodiment, the process of generating a storage index for the page data packet using the storage thread and storing the storage index and the corresponding page data packet in the database includes: when the edit change indicates that the code data in the online code editing interface is a redo change, determining a second address pointer corresponding to the redoed current operation code data in the attribute data, wherein the second address pointer is an address pointer obtained by incrementing the latest historical address pointer before redo. Through the above technical means, data redo operations can be implemented in the application development platform, improving the efficiency of application development.

[0050] In one embodiment, the first format data includes at least one of the following: JSON format data, XML format data, and YAML format data. In this embodiment of the invention, the data generated by the visual programming interface can be persistently stored in files using these different storage formats.

[0051] In this embodiment of the invention, an online code editing interface is displayed on a visual development page of an application development platform. When a change in code data is detected in the online code editing interface, the visual data structure of the visual development page is parsed, and the page data in the visual development page is converted into first format data. The visual data structure records the data structure between various page components included in the visual development page. The currently operating code data obtained through the online code editing interface is converted into attribute data of the visual development page. The attribute data is then fused with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data package matching the visual development page. This data is then processed by the application... The storage thread of the application development platform stores the page data packet in the database of the application development platform by converting the acquired current operation code data into attribute data of the visual development page; according to the visual data structure, the attribute data is fused with the first format data corresponding to the visual development page to obtain the page data packet matching the visual development page; by storing the page data packet in the database of the application development platform through the storage thread of the application development platform, the purpose of persistent storage of operation history in the application development process is achieved, thereby realizing the technical effects of persistent storage of operation history in application development, reducing system memory usage and improving application development efficiency, and thus solving the technical problem that the operation history of the application development platform is easily lost and cannot be stored for a long time.

[0052] Based on the above embodiments, in a data storage method provided in an application embodiment, such as Figure 4 As shown, the application development platform is a low-code development platform. In the low-code development platform, during the application development process, corresponding description models such as JSON, XML, or other custom description formats are used to record the above operation history. The development page, global configuration, and low-code file are stored separately as different attribute contents. For example, for the modification operation of the corresponding part of the development page, only part of the description of the development page needs to be stored (i.e., the changed attributes of the modified part are stored). For operations such as undo and redo, only the JSON or XML file of the stored description page data needs to be read. By re-parse the above JSON or XML file, the operation history of the development page can be displayed in the online code editing interface 400. When performing global configuration, the low-code file can store the operation history separately through different files and configuration information.

[0053] like Figure 5 As shown, the data structure of the application description model for the above low-code development platform is as follows:

[0054] pageInstanceList: A list of page description data structures developed for business applications, containing different page data structures such as page1, page2, and page3.

[0055] page1 (page2 / page3): A page instance has a unique page ID, data, and a list of page components (componentInstances);

[0056] componentInstances: A list of page component description model data structures, consisting of components (component1, component2, component3).

[0057] component: The data structure of page component instances, which contains xIndex (component hierarchy), xComponent (dependent child components), and xProps (component properties).

[0058] lowCodes: A list of low-code file management models, containing low-code file instance file1 and file instance file2.

[0059] file(file1 / file2): A low-code file instance data structure containing the path and the code content.

[0060] AppConfig: Application global configuration file.

[0061] Based on the above embodiments, in the data storage method provided in an application embodiment, such as... Figure 4 As shown, the Key-Value database model in code display module 404 stores the aforementioned lowCodes files. These lowCodes files can be accessed via methods such as... Figure 6 The code editing interface shown allows you to edit and modify low-code files. Figure 6 In the code editing module 602, the currently selected low-level code file is named State|global. The name of the current application and variables can be assigned values ​​in the code editing module 602, and then saved by the save button 604.

[0062] Based on the above embodiments, in the data storage method provided in one application embodiment, Figure 4 The data structure contained in the current page Example created in the middle can be used as follows: Figure 7 The structure diagram in the image is used to illustrate this, such as... Figure 7As shown, the page Example includes a page description data structure, which contains the page's ID; a page component description model data structure Componentinstances, which contains components; page components contain component hierarchy (xindex), dependent child components (xComponent), and component properties (xProps); and the low-code file management model lowCodes includes code content (code) and file path (path).

[0063] The code for the data structure corresponding to the Example page above is shown below:

[0064]

[0065]

[0066] As can be seen from the code above, the page Example includes a page id of "example", and the page components contain a component hierarchy xindex of 2. The low-code file management model lowCodes includes the code content "\n@primary-color:bulue;" and the file path "global / theme". Based on the above embodiment, in one embodiment, the above data storage method includes:

[0067] 1. Platform users have used the tools to create new applications and generate application IDs, perform development operations on the visual page, and edit code on the low-code online editor.

[0068] 2. The operation history triggers processHistory, which executes every 300ms. On the visualization page, the page parses the visualization structure and abstracts the data into data description structures such as JSON or XML. The data is then transmitted to the thread that stores the history using a web worker. Through the above techniques, the main thread resources of the web low-code platform can be saved, the low-code platform experience can be optimized, and the rendering performance can be improved.

[0069] 3. The History storage thread compares the current data with the previous data. If the data is the same, it is discarded without further processing. If the data is different, a key is generated based on the application ID + page ID or file path + username + cur. The current history pointer position (cur + 1), the latest historical record (newest + 1), and whether the maximum number of entries (fullMax) has been reached are stored in localStorage.

[0070] 4. Utilize web-based large-capacity storage methods such as IndexedDB and WebSQL to store data in a key-value format, and continue monitoring for subsequent operations to retrieve the value from IndexedDB or WebSQL using the key. This embodiment of the invention utilizes large-capacity storage on a low-code development platform, increasing the consistency of the online and offline development experience, and significantly improving efficiency and user experience for transitioning from offline to online development.

[0071] In one embodiment, the undo and redo operation process in the above data storage method is as follows:

[0072] 1. Determine whether the undo and redo operations can continue to be executed.

[0073] 2. Determine if the data structure of the currently displayed page or selected file in the browser is consistent with the data structure of the currently stored file at the cur location. If they are inconsistent, use the storage procedure to store the current page or selected file once. If they are consistent, continue to the next step.

[0074] 3. When operable, set cur to cur-1 for undo and set cur to cur+1 for redo.

[0075] 4. Generate a key based on the application ID + page ID or file path + username + cur.

[0076] 5. Page section: Obtain the value and parse it into a visual operation page. Low-code section: Obtain the value and replace the corresponding code file content.

[0077] Based on the above embodiments, in one embodiment, as follows: Figure 8 As shown, the above data storage method includes the following steps: Step S802, create a new application; Step S804, perform visual page development operations; Step S806, develop low-code files using the low-code online editor; Step S808, the user performs operations such as adding, modifying, and deleting components on the development page during normal platform use; Step S810, trigger the operation history; Step S812, perform development operations based on the operation history.

[0078] Based on the above embodiments, in one embodiment, as follows: Figure 9As shown, the above data storage method includes: Step S902, performing development operations; Step S904, the user normally uses the platform to add, modify, and delete components on the development page; Step S906, querying the operation history; Step S908, page changes triggering a periodic page update; Step S910, triggering processHistory (the throttle function's default time is 300ms), meaning the historical process processHistory will be triggered within 300ms; Step S912, abstracting the page data structure or obtaining the code content from the code editor, abstracting the visual page structure into descriptive data such as JSON or XML; Step S914, using a webworker to transmit the descriptive data to history.webwork, storing the descriptive data in the database. Step S916: Determine if the description data conforms to the preset format requirements; Step S918: If it does not conform to the preset format requirements, discard the current description data without processing; Step S920: Compare the current data; if the data is the same, proceed to step S918; Step S922: Use the internal processing logic of the web worker to store the current historical pointer position cur+1, the latest historical record newest+1, and whether the maximum number of entries (fullMax) is full in localStorage. Step S924: Store the maximum number of entries max=150; if fullMax is full, and cur+1>fullMax, set cur=1; Step S926: Generate a key based on the application ID + page ID or file path + username + cur, and generate a value based on the data + operation time; Step S928: Store the key-value data using large-capacity web storage methods such as IndexedDB and WebSQL. Step S930: Continue listening for the next storage.

[0079] Based on the above embodiments, in one embodiment, as follows: Figure 10As shown, the above data storage method includes: step S1002, performing development operations; step S1004, performing undo operations; step S1004a, using webwork to read the stored content of the page's structured data structure; step S1004b, transmitting an undo message to history.webwork; step S1004c, checking whether the stored content pointed to by the current cur pointer is consistent with the currently displayed content; if they are inconsistent, proceed to step S1008, calling the storage logic to store the current data first. If the stored content pointed to by the current cur pointer is consistent with the currently displayed content, proceed to step S1004d for discarding (hasPast) processing; step S1004e, the pointer cur is set to cur-1; step S1010, the changed pointer cur is re-pointed to the local historical content; step S1006, perform a redo operation; step S1006a, use webwork to read the stored content of the low code of the currently selected file; step S1006b, transmit a redo message to history.webwork; step S1006c, check if the stored content pointed to by the current cur pointer is consistent with the currently displayed content; if they are inconsistent, proceed to step S1008, call the storage logic to store the current data first. When the stored content pointed to by the current `cur` pointer is consistent with the currently displayed content, proceed to step S1006d for `hasPast` processing; in step S1006e, the pointer `cur` is set to `cur+1`; in step S1010, the changed pointer `cur` is re-pointed to the local historical content; in step S1012, a key is generated based on the application ID + page ID or file path + username + `cur`; in step S1014, the value is obtained from the large-capacity storage of web applications such as IndexedDB and WebSQL using the key; in step S1016, the obtained value is parsed into a visual operation page; in step S1018, the value is used to replace the corresponding code file content.

[0080] In this embodiment of the invention, an online code editing interface is displayed on a visual development page of an application development platform. When a change in code data is detected in the online code editing interface, the visual data structure of the visual development page is parsed, and the page data in the visual development page is converted into first format data. The visual data structure records the data structure between various page components included in the visual development page. The current operation code data obtained through the online code editing interface is converted into attribute data of the visual development page. The attribute data is then fused with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data package matching the visual development page. Through the above application... The storage thread of the application development platform stores the aforementioned page data packets in the database of the application development platform by converting the obtained current operation code data into attribute data of the visual development page; according to the visual data structure, the attribute data is fused with the first format data corresponding to the visual development page to obtain the page data packet matching the visual development page; through the storage thread of the application development platform, the page data packet is stored in the database of the application development platform, thereby achieving the purpose of persistent storage of operation history in the application development process. This achieves the technical effects of persistent storage of operation history in application development, reducing system memory usage, and improving application development efficiency, thus solving the technical problem that the operation history of the application development platform is easily lost and cannot be stored for a long time.

[0081] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to the present invention.

[0082] According to another aspect of the present invention, a data storage apparatus for implementing the above-described data storage method is also provided. For example... Figure 11 As shown, the device includes:

[0083] Display unit 1102 is used to display the online code editing interface in the visual development page of the application development platform;

[0084] The parsing unit 1104 is used to parse the visual data structure of the visual development page when it detects that the code data in the above-mentioned online code editing interface has been edited, and to convert the page data in the above-mentioned visual development page into first format data, wherein the above-mentioned visual data structure is used to record the data structure between the various page components included in the above-mentioned visual development page.

[0085] The conversion unit 1106 is used to convert the current operation code data obtained through the above-mentioned online code editing interface into the attribute data of the above-mentioned visual development page;

[0086] The fusion unit 1108 is used to fuse the attribute data and the first format data corresponding to the visualization development page according to the visualization data structure to obtain the page data package matched by the visualization development page.

[0087] Storage unit 1110 is used to store the page data packet into the database of the application development platform through the storage thread of the application development platform.

[0088] In this embodiment of the invention, the application development platform may include, but is not limited to, various visual application development platforms, or various application development platforms that can be dragged and dropped for editing and programming, etc., and is not limited here.

[0089] In this embodiment of the invention, when a change in code data is detected in the online code editing interface, the visual data structure of the visual development page is parsed. That is, for example, when the backend server in the application development platform detects a change in the encoded code, it parses the visual data structure of the visual development page to obtain the parsing result. For instance, if the content of the web container component on the current page is changed from state A to state B, the parsing result can be recorded as the current position of the web container and the process of the content within the container changing from A to B. The above is merely an example, and this embodiment does not impose any limitations. In this embodiment, the aforementioned first format data can be XML format data, JSON format data, or YAML format data. No limitations are imposed here.

[0090] In this embodiment of the invention, the current operation code data obtained through the online code editing interface is converted into attribute data of the visual development page; that is, the operation code corresponding to the visual page is converted into attribute data corresponding to the visual development page. In this embodiment, the attribute data may include the status information and parameter information of the visual development control, etc., which are not limited here.

[0091] In this embodiment of the invention, attribute data is fused with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data package matching the visual development page; that is, according to the data structure of the visual data and the different types of data corresponding to the data structure, the corresponding page data package is obtained and fused into the local data directory for persistent storage.

[0092] In this embodiment of the invention, the storage thread of the application development platform can be used to store and retrieve data using webwork worker threads. This avoids occupying the main thread of the user platform for display and other operations, increasing platform smoothness and providing a better user experience. In this embodiment, the webwork worker process can run background programs written by developers that can run for extended periods without user interruption, executing transactions or logic while ensuring page responsiveness. The database can include, but is not limited to, large-capacity web-based databases such as IndexedDB and WebSQL.

[0093] In one embodiment, the storage unit 1110 includes: a sending module, used to send the page data packet to the storage thread, wherein the storage thread is a sub-thread configured for the main development thread of the application development platform;

[0094] The storage module is used to generate a storage index for the page data packet through the storage thread, and store the storage index and the corresponding page data packet in the local storage database, wherein the storage index is used to uniquely identify the page data packet.

[0095] In this embodiment of the invention, an online code editing interface is displayed on a visual development page of an application development platform. When a change in code data is detected in the online code editing interface, the visual data structure of the visual development page is parsed, and the page data in the visual development page is converted into first format data. The visual data structure records the data structure between various page components included in the visual development page. The current operation code data obtained through the online code editing interface is converted into attribute data of the visual development page. The attribute data is then fused with the first format data corresponding to the visual development page according to the visual data structure to obtain a page data package matching the visual development page. Through the above application... The storage thread of the application development platform stores the aforementioned page data packets in the database of the application development platform by converting the obtained current operation code data into attribute data of the visual development page; according to the visual data structure, the attribute data is fused with the first format data corresponding to the visual development page to obtain the page data packet matching the visual development page; through the storage thread of the application development platform, the page data packet is stored in the database of the application development platform, thereby achieving the purpose of persistent storage of operation history in the application development process. This achieves the technical effects of persistent storage of operation history in application development, reducing system memory usage, and improving application development efficiency, thus solving the technical problem that the operation history of the application development platform is easily lost and cannot be stored for a long time.

[0096] According to another aspect of the present invention, an electronic device for implementing the above-described data storage method is also provided. This electronic device may be... Figure 1 The terminal device or server shown. This embodiment uses the electronic device as a client as an example for illustration. Figure 12 As shown, the electronic device includes a memory 1202 and a processor 1204. The memory 1202 stores a computer program, and the processor 1204 is configured to execute the steps of any of the above method embodiments through the computer program.

[0097] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.

[0098] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0099] S1 displays the online code editing interface on the visual development page of the application development platform;

[0100] S2, when it is detected that the code data in the online code editing interface has been edited, the visualization data structure of the visualization development page is parsed and the page data in the visualization development page is converted into the first format data. The visualization data structure is used to record the data structure between the various page components included in the visualization development page.

[0101] S3 converts the current operation code data obtained through the online code editing interface into attribute data for the visual development page;

[0102] S4. Based on the visualization data structure, the attribute data is fused with the first format data corresponding to the visualization development page to obtain the page data package that matches the visualization development page.

[0103] S5 stores page data packets in the application development platform's database through the application development platform's storage thread.

[0104] Alternatively, as those skilled in the art will understand, Figure 12 The structure shown is for illustrative purposes only. Electronic devices can also be smartphones (such as Android phones, iOS phones, etc.), tablets, PDAs, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 12 This does not limit the structure of the aforementioned electronic devices or electronic equipment. For example, electronic devices or electronic equipment may also include components that are more... Figure 12 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 12 The different configurations shown.

[0105] The memory 1202 can be used to store software programs and modules, such as the program instructions / modules corresponding to the data storage method and apparatus in this embodiment of the invention. The processor 1204 executes various functional applications and data processing by running the software programs and modules stored in the memory 1202, thereby realizing the aforementioned data storage method. The memory 1202 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1202 may further include memory remotely located relative to the processor 1204, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 1202 may be used, but is not limited to, to store information such as visual data structures, attribute data of visual development pages, and page data packets. As an example, such as... Figure 12As shown, the memory 1202 may include, but is not limited to, the display unit 1102, parsing unit 1104, conversion unit 1106, fusion unit 1108, and storage unit 1110 of the data storage device. Furthermore, it may include, but is not limited to, other module units of the data storage device, which will not be described further in this example.

[0106] Optionally, the transmission device 1206 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 1206 includes a Network Interface Controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 1206 is a radio frequency (RF) module, used for wireless communication with the Internet.

[0107] In addition, the aforementioned electronic device also includes: a display 1208 for displaying attribute data and page data package information of the aforementioned visual development page; and a connection bus 1210 for connecting various module components in the aforementioned electronic device.

[0108] In other embodiments, the aforementioned terminal device or server can be a node in a distributed system, wherein the distributed system can be a blockchain system, which is a distributed system formed by connecting multiple nodes through network communication. The nodes can form a peer-to-peer (P2P) network, and any form of computing device, such as a server, terminal, or other electronic device, can become a node in the blockchain system by joining this peer-to-peer network.

[0109] According to one aspect of this application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the data storage method described above. The computer program is configured to perform the steps of any of the method embodiments described above when running.

[0110] Optionally, in this embodiment, the computer-readable storage medium described above may be configured to store a computer program for performing the following steps:

[0111] S1 displays the online code editing interface on the visual development page of the application development platform;

[0112] S2, when it is detected that the code data in the online code editing interface has been edited, the visualization data structure of the visualization development page is parsed and the page data in the visualization development page is converted into the first format data. The visualization data structure is used to record the data structure between the various page components included in the visualization development page.

[0113] S3 converts the current operation code data obtained through the online code editing interface into attribute data for the visual development page;

[0114] S4. Based on the visualization data structure, the attribute data is fused with the first format data corresponding to the visualization development page to obtain the page data package that matches the visualization development page.

[0115] S5 stores page data packets in the application development platform's database through the application development platform's storage thread.

[0116] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0117] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0118] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0119] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0120] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0121] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0122] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0123] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A data storage method, characterized in that, include: Display the online code editing interface on the visual development page of the application development platform; When a change in the state of a container component is detected in the online code editing interface, the visualization data structure matching the container component whose state has changed in the visualization development page is parsed, and the page data in the visualization data structure is converted into first format data, wherein the visualization data structure is used to record the data structure between the various page components included in the visualization development page. If the current operation code data obtained through the online code editing interface is different from the historical operation code data read from the database of the application development platform, the current operation code data is converted into attribute data of the visual development page; The attribute data is fused with the first format data according to the visualization data structure to obtain a page data package that matches the visualization development page; The process of storing the page data package in the database via the storage thread of the application development platform includes: reading historical operation code data from the database; comparing the historical operation code data with the current operation code data in the attribute data via the storage thread; discarding the current operation code data if the historical operation code data and the current operation code data are the same; generating a first storage index for the first format data in the page data package and a second storage index for the attribute data in the page data package if the historical operation code data and the current operation code data are different; storing the first format data and the first storage index in the database at a first address; determining the current historical pointer of the historical operation code data in the database; and incrementing the current historical pointer by 1 to obtain the address pointer corresponding to the second address.

2. The method according to claim 1, characterized in that, Storing the page data packet into the database of the application development platform through the platform's storage thread includes: The page data packet is sent to the storage thread, wherein the storage thread is a sub-thread configured for the main development thread of the application development platform; The storage thread generates a storage index for the page data packet, and stores the storage index and the corresponding page data packet in the database, wherein the storage index is used to uniquely identify the page data packet.

3. The method according to claim 1, characterized in that, After generating a first storage index for the first format data in the page data packet and generating a second storage index for the attribute data in the page data packet, the method further includes: The number of entries in the historical page data packets already stored in the database is incremented by one to obtain the updated number of entries; If the updated number of entries has not yet reached the maximum number of entries stored in the database, it is determined that the first format data and the first storage index are stored in the first address of the database, and the attribute data and the second storage index are stored in the second address of the database.

4. The method according to claim 2, characterized in that, The step of generating a storage index for the page data packet through the storage thread and storing the storage index and the corresponding page data packet in the database includes: When the code data in the online code editing interface is an undo change, the first address pointer corresponding to the currently operated code data that was undone in the attribute data is determined; The current operation code data is stored in the database, and the first address pointer is decremented by one.

5. The method according to claim 4, characterized in that, The step of generating a storage index for the page data packet through the storage thread and storing the storage index and the corresponding page data packet in the database includes: When the code data in the online code editing interface is a redo change as indicated by the edit change, the second address pointer corresponding to the redoed current operation code data in the attribute data is determined, wherein the second address pointer is the address pointer after incrementing the latest historical address pointer before redo.

6. The method according to any one of claims 1 to 5, characterized in that, The first format data includes at least one of the following: JSON format data, XML format data, and YAML format data.

7. A data storage device, characterized in that, include: The display unit is used to display the online code editing interface in the visual development page of the application development platform; The parsing unit is used to parse the visual data structure that matches the container component whose state has changed in the visual development page when the state of the container component in the online code editing interface is detected to have changed, and to convert the page data in the visual data structure into first format data. The visual data structure is used to record the data structure between the various page components included in the visual development page. The conversion unit is used to convert the current operation code data into attribute data of the visual development page when the current operation code data obtained through the online code editing interface is different from the historical operation code data read from the database of the application development platform. The fusion unit is used to fuse the attribute data with the first format data according to the visualization data structure to obtain a page data package that matches the visualization development page; A storage unit is used to store the page data package into the database through the storage thread of the application development platform, including: reading historical operation code data from the database; comparing the historical operation code data with the current operation code data in the attribute data through the storage thread; discarding the current operation code data if the historical operation code data and the current operation code data are the same; generating a first storage index for the first format data in the page data package and generating a second storage index for the attribute data in the page data package if the historical operation code data and the current operation code data are different; storing the first format data and the first storage index into a first address in the database; determining the current historical pointer of the historical operation code data in the database; and incrementing the current historical pointer by 1 to obtain the address pointer corresponding to the second address.

8. The apparatus according to claim 7, characterized in that, The storage unit includes: A sending module is used to send the page data packet to the storage thread, wherein the storage thread is a sub-thread configured for the main development thread of the application development platform; A storage module is used to generate a storage index for the page data packet through the storage thread, and store the storage index and the corresponding page data packet in the database, wherein the storage index is used to uniquely identify the page data packet.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method according to any one of claims 1 to 6.

10. A computer program product comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, they implement the steps of the method according to any one of claims 1 to 6.

11. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 6 through the computer program.

Citation Information

Patent Citations

  • Visual page processing method and device, computer equipment and storage medium

    CN111930370A