File storage, reading method, device and storage medium
By using a unified template storage format, the files of the middle platform application are divided into file headers and file bodies, which solves the problem of low efficiency in storing templates for different types of applications and enables fast previewing and distribution.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ALIBABA (CHINA) CO LTD
- Filing Date
- 2023-03-20
- Publication Date
- 2026-05-29
AI Technical Summary
In existing technologies, the storage methods for application templates in the middle platform are different, which makes it impossible to preview and distribute them quickly, resulting in low efficiency, especially in multi-type application scenarios.
A unified template storage format is adopted to divide the output files of the middle platform application into file headers and file bodies. The file header stores the application type and file segment information, while the file body stores the file segments, enabling self-interpretation and fast preview.
It enables universal storage for different types of middleware applications, supports fast preview and distribution, and improves the data preview efficiency of application templates.
Smart Images

Figure CN116501707B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a file storage and retrieval method, device and storage medium. Background Technology
[0002] Currently, when large enterprises build a middle platform, the headquarters typically handles the construction, generating application templates for the middle platform. These templates are then distributed to various subsidiaries to flexibly and quickly address their front-end needs and improve development efficiency. Generally, different application types use different storage methods for their templates. When there are many application types, the application templates generated by building the middle platform architecture will also be diverse.
[0003] In some typical existing technologies, different types of application templates are usually stored using different directory structures, and these templates are compressed for storage. This approach is not conducive to rapid application preview. Therefore, a new solution is needed. Summary of the Invention
[0004] This application provides a file storage and retrieval method, device, and storage medium to provide a template storage method applicable to different types of middleware applications, thereby improving the data preview efficiency of application templates.
[0005] This application provides a file storage method, including: obtaining output files from multiple middleware applications; the multiple middleware applications correspond to different application types; storing the output files of the multiple middleware applications according to a template storage format to obtain multiple application templates; the multiple application templates are used to distribute to the front end for use; wherein, the template storage format includes: a file header and a file body; the file header is used to store the application type of any middleware application and file information of at least one file segment of the middleware application; the file body is used to store the at least one file segment of the middleware application.
[0006] Optionally, the output files of the multiple middleware applications are stored according to a template storage format to obtain multiple application templates, including: splitting the output files of the middleware applications into fragments according to the data categories of the middleware applications to obtain at least one file fragment; storing the at least one file fragment in the file body in sequence, and storing the application type of the middleware application and the file information of each of the at least one file fragment in the file header.
[0007] Optionally, the data categories include at least one of the following: basic information category, modeling metadata category, application metadata category, operational metadata category, and personalized data category of the middle platform application.
[0008] Optionally, the file information of each of the at least one file fragment is stored in the file header, including: for any file fragment among the at least one file fragment, determining the target field position of the file fragment in the file header according to the storage order of the file fragment in the file body; and storing the data size of the file fragment at the target field position.
[0009] Optionally, it further includes: storing the file header data size in the file header; the file header data size being used to determine the offset of each of the at least one file fragments by comparing it with the data size of the at least one file fragment; and the offset of any file fragment being used to determine the position of the file fragment within the file body by comparing it with the data size of the file fragment.
[0010] Optionally, it further includes: storing verification information in the file header; the verification information includes at least: data security verification, and / or, data integrity verification.
[0011] This application embodiment also provides a file reading method, including: responding to a template viewing operation for a middleware application by sending a viewing request to a server; the application template of the middleware application is stored using the file storage method provided in this application embodiment; receiving the file header of the application template returned by the server; and displaying the application type contained in the file header and file information of at least one file segment of the middleware application.
[0012] Optionally, it further includes: responding to a selection operation for a target file segment in the file header, sending a view request to the server based on the file information of the target file segment, so that the server determines the index information of the target file segment based on the file information of the target file segment and the data size of the file header; the index information is used to query the target file segment in the file body; and receiving and displaying the target file segment returned by the server.
[0013] This application also provides an electronic device, including: a memory and a processor; the memory is used to store one or more computer instructions; the processor is used to execute the one or more computer instructions to perform the steps in the method provided in this application.
[0014] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps in the method provided in this application.
[0015] In this embodiment, output files from different types of middleware applications are stored according to a unified template storage format, thus supporting the storage of output files from various types of middleware applications. The file header stores the application type of the middleware application and file information for at least one file segment of the application. This facilitates a clear understanding of the application type corresponding to the application template and supports quick previewing of file segment information within the application template. In other words, the application template can be "self-explanatory" based on the information stored in the file header, eliminating the need to download or decompress the entire application template during distribution or viewing. Therefore, while enabling universal storage for various types of middleware applications, it also facilitates rapid previewing and distribution of application templates of different types. Attached Figure Description
[0016] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0017] Figure 1 A flowchart illustrating a file storage method provided for an exemplary embodiment of this application;
[0018] Figure 2 A schematic diagram of the storage structure of the application template of the central application provided in an exemplary embodiment of this application;
[0019] Figure 3 A schematic diagram of the storage structure of an application template for a lightweight application provided in an exemplary embodiment of this application;
[0020] Figure 4 A schematic diagram of the storage structure of an application template for a managed application provided as an exemplary embodiment of this application;
[0021] Figure 5 A schematic flowchart illustrating a file reading method provided in an exemplary embodiment of this application;
[0022] Figure 6 A schematic diagram of the structure of an electronic device provided for an exemplary embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0024] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” used in the embodiments of this invention and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise. “Multiple” generally includes at least two, but does not exclude the inclusion of at least one.
[0025] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0026] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.
[0027] In some methods that store application templates based on directory structures, data such as images and files within the application template are typically stored in different directories according to category and then uniformly compressed. On one hand, the directory structure cannot distinguish between different types of templates, and different types of application templates have different structures. When reading or distributing application templates, each type needs to be processed separately, which is not conducive to rapid distribution. On the other hand, the data volume of application templates is large, and the compressed directory structure cannot support rapid previewing.
[0028] To address the aforementioned technical problems, a solution is provided in some embodiments of this application. The technical solutions provided by each embodiment of this application are described in detail below with reference to the accompanying drawings.
[0029] Figure 1 This is a flowchart illustrating a file storage method provided in an exemplary embodiment of this application. The method may include, for example: Figure 1 The steps shown are as follows:
[0030] Step 101: Obtain the output files of each of the multiple middleware applications; the multiple middleware applications correspond to different application types.
[0031] Step 102: Store the output files of the multiple middleware applications according to the template storage format to obtain multiple application templates; the multiple application templates are used to distribute to the front end for use; wherein, the template storage format includes: a file header and a file body; the file header is used to store the application type of any middleware application and the file information of at least one file segment of the middleware application; the file body is used to store the at least one file segment of the middleware application.
[0032] The execution entity in this embodiment can be a middleware development platform. In the "front-end-middleware-back-end" service architecture, the middleware can provide shared services to the front-end to reduce front-end development costs. After the middleware development platform completes the development of the middleware application, it can store the output files (or deliverables) of the middleware application to generate an application template. The front-end can quickly complete front-end development based on this application template. The types of middleware applications can include at least one of the following: central application type, lightweight application type, and managed application type. Among them, the output files of different types of middleware applications are diverse, such as images, JAR (Java Archive, a software package file format), and other files (such as compressed files, images, etc.).
[0033] A central application, developed according to the Domain-Driven Design (DDD) principle, is an application designed to provide services within a specific domain, such as an order center or a user center. The development of a central application typically involves several stages, including modeling and design, application development, application deployment, and operation and maintenance. The typical deliverables of a central application include a JAR file and an image.
[0034] Lightweight applications are applications developed rapidly using a low-code approach. The deliverables of a lightweight application mainly include various front-end orchestration files. Typically, the deliverables of a lightweight application are packaged into a single compressed file as the final deliverable.
[0035] Hosted applications refer to applications whose existing images or code are hosted on a development platform. The output files of a hosted application typically include multiple images.
[0036] After acquiring at least one of the aforementioned middleware applications, the output files of each application can be stored to obtain an application template, which can then be sent to the front-end for use. The application template is a template file created based on the application's development data. The application template can be imported into other front-end development or operation platforms and reinstalled. When the application template is reinstalled, the user can modify limited information within the template, thereby enabling the template creator to control the user.
[0037] In this embodiment, a template storage format suitable for various types of middleware applications is provided. By storing the output files of any type of middleware application according to this template storage format, an application template for that type of middleware application can be generated.
[0038] The template storage format includes a file header and a file body (or payload). The file body stores at least one file fragment of any middleware application; the file header stores the application type of any middleware application and the file information of at least one file fragment of that application. At least one file fragment of a middleware application refers to a file block obtained by splitting the output files (e.g., images, JAR files, etc.) generated during the construction of the middleware application. The file information of this at least one file fragment may include: the data category and / or data size of the at least one file fragment, to facilitate previewing the files contained in the middleware application.
[0039] Based on this implementation, output files from different types of middleware applications are stored according to a unified template storage format, enabling support for storing output files from various middleware application types. The file header stores the application type of the middleware application and file information for at least one file segment of the application. This facilitates a clear understanding of the application type corresponding to the application template and supports quick previewing of file segment information within the application template. In other words, the application template can be "self-explanatory" based on the information stored in the file header, eliminating the need to download or decompress the entire application template during distribution or viewing. Therefore, while enabling universal storage for various types of middleware applications, it also facilitates rapid previewing and distribution of application templates of different types.
[0040] In some optional embodiments, when storing any middleware application according to a template storage format, the output files of the middleware application can be fragmented to divide large volumes of output files into smaller data blocks, thereby facilitating categorized storage and rapid preview. The following will use any middleware application as an example for illustrative purposes.
[0041] Optionally, for any middleware application, the application can be segmented according to its data category to obtain at least one file segment. This at least one file segment is then stored sequentially in the file body, and the application type of the middleware application and the file information of each of the at least one file segment are stored in the file header.
[0042] The data category of a middle platform application refers to the category of its output files. Typically, the construction process of a middle platform application involves stages such as modeling and design, application development, application deployment, and operation and maintenance. Each of these stages can produce different categories of data. Accordingly, the data category of any middle platform application's output file can include at least one of the following: basic information category, modeling metadata category, application metadata category, operational metadata category, and personalized data category of the middle platform application. Based on these data categories, the output files of the middle platform application can be divided into file fragments of at least one of the following: basic information, modeling metadata, application metadata, operational metadata, and personalized data.
[0043] The basic information mainly describes the information of the middleware application itself and its templates. The basic information may include, but is not limited to, at least one of the following: application code, application name, template code, template creator identifier, and template creation time.
[0044] The modeling metadata describes the modeling data generated when modeling the middle platform application using the DDD method on the development platform. This modeling metadata includes, but is not limited to, at least one of the following: data model, API (Application Programming Interface), and class model. The class model describes the static structure (attributes, operations, relationships, identifiers, etc.) of the objects and their relationships within the model.
[0045] The application metadata describes the runtime information of the middleware application, including but not limited to at least one of the following: resources required for the middleware application to run (such as memory, processor, disk, etc.), number of replicas, and startup command line.
[0046] Among them, the operational metadata is used to describe the operational and promotional information of the middle platform application, including but not limited to at least one of the traffic analysis, content delivery, and content update operations that the middle platform application needs to perform during operation.
[0047] Personalized data components refer to the differentiated components that different types of middleware applications possess. For example, personalized data for hosted applications may include: components of the hosted application; personalized data for lightweight applications may include: lightweight application files.
[0048] The template storage format will be further illustrated below with reference to the accompanying drawings.
[0049] In this embodiment, different types of middleware applications may include some of the same data categories and some of different data categories. For example, such as Figure 2As shown, the data categories of the central application include: basic information, modeling metadata, application metadata, and at least one of the following: images. For example, Figure 3 As shown, the data categories for lightweight applications include: basic information, modeling metadata, application metadata, and at least one of the following from the lightweight application files. For example, such as... Figure 4 As shown, the data categories of the managed application include at least one of the following: basic information, modeling metadata, application metadata, and component images.
[0050] Based on the aforementioned data categories, the output files of the middleware application can be fragmented to obtain multiple file fragments corresponding to different data categories, and each file fragment is stored sequentially within a file body. In this implementation, fragmenting and storing the output files of the middleware application according to data categories can achieve general storage while meeting personalized and differentiated storage needs.
[0051] In some optional embodiments, the file header includes several fields, including fields for storing file information for at least one file fragment. The storage order of the file fragments and the storage order of their file information can be consistent to form a sequential correspondence, thereby facilitating indexing and querying of the file fragments. When storing the file information of each of the at least one file fragment in the file header, the positions of the corresponding fields for each of the at least one file fragment can be determined sequentially in the file header according to the storage order of the at least one file fragment in the file body, and the file information of each of the at least one file fragment can be stored in the fields corresponding to those field positions. Examples will be provided below.
[0052] For any file segment among the at least one file segments, the position of the target field in the file header can be determined according to the storage order of the file segment. For example, the output files of a certain platform application are divided into 5 file segments: A1, A2, A3, A4, and A5; the 5 file segments are stored sequentially in the file body. The file header contains 5 fields used to store file information of the above file segments. The target field position corresponding to file segment A3 in the file header is the 3rd field position, and the target field position corresponding to file segment A5 is the 5th field position.
[0053] Continuing with any file segment as an example, after determining the target field location of the file segment, the data size of the file segment can be stored at that target field location. For example... Figure 2 , Figure 3 as well as Figure 4As shown, the file information of each of the at least one file fragment stored in the file header may include at least one of the following: basic information size, modeling metadata size, application metadata size, operational metadata size, and the size of personalized data components. The data size of the file fragment describes its storage length within the file body. When previewing or distributing the application template, data of the corresponding length can be read from the file body based on the data size of the fragment, enabling fast reading of individual file fragments.
[0054] In some optional embodiments, the file header may also store the file header data size. For example, the file header data size can be fixed according to storage requirements, and storage lengths can be allocated for multiple fields in the file header. These multiple fields include a designated field for storing the file header data size. Based on this, during the preview and distribution of the template file, this designated field can be read to obtain the file header data size, and the data corresponding to this size can be quickly read from the application template to obtain the file header. For example, in some embodiments, the total size of the file header is fixed at 72 bytes. During the preview and distribution of the template file, reading 72 bytes at once yields the complete file header information, further improving preview efficiency.
[0055] On the other hand, based on the file header data size and the data size of at least one file fragment, index information for each file fragment can be generated to facilitate quick querying of file fragments within the file body. Further examples will be provided below.
[0056] The file header data size is used to determine the offset of each of the at least one file fragments by comparing it with the data size of the at least one file fragment; the offset of any file fragment is used to determine the position of the file fragment in the file body by comparing it with the data size of the file fragment, thereby quickly locating the at least one file fragment in the file body.
[0057] For example, if the basic information is stored first in the file body, then the offset of the basic information within the entire application template is equal to the file header size. The basic information can be quickly retrieved from the application template using this offset and the size of the basic information.
[0058] For example, if the modeling metadata is stored after the basic information in the file body, then the offset of the modeling metadata within the entire application template is: file header size + basic information size. Based on the offset and size of the modeling metadata, it can be quickly retrieved from the application template.
[0059] For example, if the application metadata is stored after the modeling metadata in the file body, then the offset of the application metadata within the entire application template is: file header size + basic information size + modeling metadata size. Based on the offset and size of the application metadata, the application metadata can be quickly retrieved from the application template.
[0060] For example, if the operational metadata is stored after the application metadata in the file body, then the offset of the operational metadata within the entire application template is: file header size + basic information size + modeling metadata size + application metadata size. Based on the offset and size of the operational metadata, it can be quickly retrieved from the application template.
[0061] For example, in the application template of the central application, if the image is stored after the operational metadata in the file body, then the offset of the image in the entire application template is: file header size + basic information size + modeling metadata size + application metadata size + operational metadata size. Based on the image offset and image size, the image can be quickly retrieved from the application template.
[0062] For example, in a lightweight application template, the lightweight application file is stored after the operational metadata within the file body. Therefore, the offset of the lightweight application file within the entire application template is: file header size + basic information size + modeling metadata size + application metadata size + operational metadata size. Based on the offset and image size of the lightweight application file, it can be quickly retrieved from the application template.
[0063] For example, in the application template of a hosted application, if the component template is stored after the operational metadata in the file body, then the offset of the component template in the entire application template is: file header size + basic information size + modeling metadata size + application metadata size + operational metadata size. Based on the component template offset and image size, the component template of the hosted application can be quickly obtained from the application template.
[0064] Based on the aforementioned implementation method, the multiple fields included in the file header of the application template achieve "self-interpretation" and "self-indexing", enabling on-demand reading and parsing of the template file, further improving the preview and distribution efficiency of the application template.
[0065] In some optional embodiments, several fields in the file header may also include reserved fields. The number of bytes in these reserved fields can be set as needed, for example, nine 4-byte reserved words, to facilitate subsequent expansion. For example, in the application template of a managed application, reserved fields can be used to record the size of the corresponding component template.
[0066] In some optional embodiments, the file header may further include an application type field and a verification field. The verification field includes at least one of a security verification field and an integrity verification field.
[0067] The application type field stores the corresponding application type of the application template. For example, the field value can include: central application, lightweight application, or managed application. Based on the application type field, a unified template storage format can be implemented to support different types of middleware applications, and it is easy to distinguish between different types of application templates.
[0068] The security verification field primarily stores a magic number, which is a number defined by the developer to express a specific meaning. In some embodiments, this magic number can be used to verify the application template's development platform. For example, the magic number can be a value defined by the development platform. After the application template is distributed to the user, the user can install the application template on the development platform. The development platform can read the magic number in the security verification field and verify it. If the verification result indicates that the application template is an application template produced on a specified type of development platform, then it can be determined that the application template can be read and installed. In other embodiments, the magic number can be used to verify the compliance of the application template. For example, the magic number can be a value defined by the developer of the middleware application. The user of the application template can determine whether the received application template is a compliant application template by verifying whether the magic number is the same as a predefined value.
[0069] The integrity check field stores the total size of the file body. When the application template is parsed, the recipient can obtain the actual size of the file body and compare it with the size stored in the integrity check field. If the two are inconsistent, the application template is considered corrupted.
[0070] In this implementation, the application template's storage format is divided into two parts: a file header and a file body. The file body is divided into blocks according to the data categories of the output, and the file header stores the index of each block. This facilitates on-demand parsing of the application template file, enabling rapid parsing of various information within the file without requiring file downloads. Furthermore, the fields defined in the file header ensure uniformity across various application template files, and reserved fields support extensibility, allowing for support of more subsequent application file types.
[0071] In addition to the file storage method described in the foregoing embodiments, this application also provides a file reading method, which will be described below in conjunction with the accompanying drawings.
[0072] Figure 5 A flowchart illustrating a file reading method provided in an exemplary embodiment of this application is shown below. Figure 5 As shown, the method includes:
[0073] Step 501: Respond to the template viewing operation for the middle platform application by sending a viewing request to the server.
[0074] Step 502: Receive the file header of the application template of the middle platform application returned by the server.
[0075] Step 503: Display the information contained in the file header; wherein, the file header is used to store the application type of the middle platform application and the file information of at least one file fragment of the middle platform application; the at least one file fragment is stored in the file body of the application template.
[0076] The execution entity in this embodiment can be either the receiving device of the application template or the distributing device during the application template distribution process. This receiving or distributing device can be a computer, tablet, smartphone, etc., and this embodiment is not limited to any particular type. The receiving or distributing device can view the template data of the middleware application based on a browser or application running on it.
[0077] Optionally, in response to a selection operation on a target file segment in the file header, a viewing request is sent to the server based on the file information of the target file segment. Furthermore, the server can determine the index information of the target file segment based on the file information of the target file segment and the data size of the file header. The index information is used to query the target file segment within the file body. The terminal device can receive and display the target file segment returned by the server.
[0078] In this implementation, output files from different types of middleware applications are stored according to a unified template storage format, enabling support for storing output files from various middleware application types. The file header stores the application type of the middleware application and file information for at least one file segment of the application. This facilitates a clear understanding of the application type corresponding to the application template and supports quick previewing of file segment information within the application template. In other words, the application template can be "self-explanatory" based on the information stored in the file header; the entire application template does not need to be downloaded or decompressed during distribution or viewing. Therefore, when the front-end views the application template, it only needs to obtain the file header, without needing to read or download the entire application template, which facilitates rapid previewing and distribution of different types of application templates.
[0079] It should be noted that the execution subject of each step of the method provided in the above embodiments can be the same device, or the method can be executed by different devices. For example, the execution subject of steps 101 to 104 can be device A; or the execution subject of steps 101 and 102 can be device A, and the execution subject of step 103 can be device B; and so on.
[0080] Furthermore, some processes described in the above embodiments and accompanying drawings include multiple operations appearing in a specific order. However, it should be clearly understood that these operations may not be executed in the order they appear herein, or they may be executed in parallel. The operation numbers, such as 101, 102, etc., are merely used to distinguish different operations and do not represent any execution order. Additionally, these processes may include more or fewer operations, and these operations may be executed sequentially or in parallel. It should be noted that the descriptions such as "first" and "second" in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to different types.
[0081] Figure 6 This application illustrates a schematic diagram of the structure of an electronic device provided in an exemplary embodiment, as shown below. Figure 6 As shown, the electronic device includes a memory 601 and a processor 602.
[0082] Memory 601 is used to store computer programs and can be configured to store various other data to support operation on the electronic device. Examples of this data include instructions for any application or method used to operate on the electronic device.
[0083] In some alternative embodiments, Figure 6 The illustrated electronic device can be used to execute a file storage method. A processor 602, coupled to a memory 601, executes a computer program in the memory 601 to: acquire output files from multiple middleware applications; the multiple middleware applications correspond to different application types; store the output files of the multiple middleware applications according to a template storage format to obtain multiple application templates; the multiple application templates are distributed to the front end for use; wherein the template storage format includes: a file header and a file body; the file header stores the application type of any middleware application and file information of at least one file fragment of the middleware application; the file body stores the at least one file fragment of the middleware application.
[0084] Optionally, when the processor 602 stores the output files of the multiple middleware applications according to the template storage format to obtain multiple application templates, it specifically performs the following: according to the data category of the middleware application, it performs fragment processing on the output files of the middleware application to obtain at least one file fragment; it stores the at least one file fragment in the file body in sequence, and stores the application type of the middleware application and the file information of each of the at least one file fragment in the file header.
[0085] Optionally, the data categories include at least one of the following: basic information category, modeling metadata category, application metadata category, operational metadata category, and personalized data category of the middle platform application.
[0086] Optionally, when the processor 602 stores the file information of each of the at least one file fragment in the file header, it is specifically used to: for any file fragment among the at least one file fragment, determine the target field position of the file fragment in the file header according to the storage order of the file fragment in the file body; and store the data size of the file fragment at the target field position.
[0087] Optionally, the processor 602 is further configured to: store the file header data size in the file header; use the file header data size and the data size of the at least one file segment to determine the offset of each of the at least one file segment; and use the offset of any file segment and the data size of the file segment to determine the position of the file segment in the file body.
[0088] Optionally, the processor 602 is further configured to: store verification information in the file header; the verification information includes at least:
[0089] Data security verification, and / or data integrity verification.
[0090] In some alternative embodiments, Figure 6 The illustrated electronic device can be used to execute a file reading method. The processor 602 is configured to: respond to a template viewing operation for a middleware application by sending a viewing request to a server; the application template of the middleware application is stored using the file storage method provided in this embodiment; receive the file header of the application template returned by the server; and display the application type contained in the file header and file information of at least one file segment of the middleware application.
[0091] Optionally, the processor 602 is further configured to: respond to a selection operation for a target file segment in the file header, send a viewing request to the server based on the file information of the target file segment, so that the server determines the index information of the target file segment based on the file information of the target file segment and the data size of the file header; the index information is used to query the target file segment in the file body; and receive and display the target file segment returned by the server.
[0092] Furthermore, such as Figure 6 As shown, the electronic device also includes other components such as a communication component 603, a power supply component 604, a display component 605, and an audio component 606. Figure 6 The diagram only shows some components and does not mean that the electronic device includes only these components. Figure 6 The components shown.
[0093] The memory 601 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.
[0094] The communication component 603 is configured to facilitate wired or wireless communication between the device containing the communication component and other devices. The device containing the communication component can access wireless networks based on communication standards, such as Wi-Fi, 2G (e.g., Global System for Mobile Communications (GSM)), 3G (e.g., Wideband Code Division Multiple Access (WCDMA), 4G (e.g., Long Term Evolution (LTE)), 4G+ (e.g., LTE-Advanced (LTE-A)), or 5G (5th Generation Mobile Communication Technology), or combinations thereof. In one exemplary embodiment, the communication component receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component may be implemented based on Near Field Communication (NFC), Radio Frequency Identification (RFID), Infrared Data Association (IrDA), Ultra Wideband (UWB), Bluetooth (BT), and other technologies.
[0095] The power supply component 604 is used to provide power to various components of the device in which it resides. The power supply component may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the device in which it resides.
[0096] Display component 605 includes a screen, which may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen can be implemented as a touchscreen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors can sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation.
[0097] Audio component 606 can be configured to output and / or input audio signals. For example, the audio component includes a microphone (MIC) configured to receive external audio signals when the device in which the audio component is located is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals can be further stored in memory or transmitted via a communication component. In some embodiments, the audio component also includes a speaker for outputting audio signals.
[0098] In this embodiment, output files from different types of middleware applications are stored according to a unified template storage format, enabling support for storing output files from various middleware applications. The file header stores the application type of the middleware application and file information for at least one file segment of the application. This facilitates a clear understanding of the application type corresponding to the application template and supports quick previewing of file segment information within the application template. In other words, the application template can be "self-explanatory" based on the information stored in the file header, eliminating the need to download or decompress the entire application template during distribution or viewing. Therefore, while enabling universal storage for various types of middleware applications, it also facilitates rapid previewing and distribution of application templates of different types.
[0099] Accordingly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed, can implement the steps that can be performed by an electronic device in the above method embodiments.
[0100] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0101] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0102] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0103] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0104] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0105] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0106] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0107] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0108] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A file storage method, characterized in that, include: Obtain the output files from multiple middleware applications; The multiple middleware applications correspond to different application types; The output files of the multiple middleware applications are stored according to the template storage format to obtain multiple application templates; The aforementioned application templates are used to distribute them to the front end for use; The template storage format includes a file header and a file body; the file header stores the application type of any middleware application and file information of at least one file segment of the middleware application; the file body stores the at least one file segment of the middleware application.
2. The method according to claim 1, characterized in that, The output files of the multiple middleware applications are stored according to a template storage format to obtain multiple application templates, including: Based on the data category of the middle platform application, the output files of the middle platform application are split into fragments to obtain at least one file fragment. The at least one file fragment is stored sequentially in the file body, and the application type of the middle platform application and the file information of each of the at least one file fragment are stored in the file header.
3. The method according to claim 2, characterized in that, The data categories include at least one of the following: basic information category, modeling metadata category, application metadata category, operational metadata category, and personalized data category of the middle platform application.
4. The method according to claim 2, characterized in that, The file header stores file information for each of the at least one file fragment, including: For any file segment among the at least one file segment, the position of the target field corresponding to the file segment in the file header is determined according to the storage order of the file segment in the file body; The data size of the file fragment is stored at the target field location.
5. The method according to claim 4, characterized in that, Also includes: The file header stores the file header data size; the file header data size is used to determine the offset of each of the at least one file fragments, together with the data size of the at least one file fragment; the offset of any file fragment is used to determine the position of the file fragment within the file body, together with the data size of the file fragment.
6. The method according to claim 2, characterized in that, Also includes: Verification information is stored in the file header; The verification information includes at least: data security verification, and / or, data integrity verification.
7. A file reading method, characterized in that, include: In response to a template viewing operation for a middleware application, a viewing request is sent to the server. The application template of the middle platform application is stored using the method described in any one of claims 1-6; Receive the file header of the application template returned by the server; The file header contains the application type and file information for at least one file fragment of the middleware application.
8. The method according to claim 7, characterized in that, Also includes: In response to a selection operation for a target file segment in the file header, a view request is sent to the server based on the file information of the target file segment, so that the server determines the index information of the target file segment based on the file information of the target file segment and the data size of the file header; the index information is used to query the target file segment in the file body; Receive and display the target file fragments returned by the server.
9. An electronic device, characterized in that, include: Memory and processor; The memory is used to store one or more computer instructions; The processor is configured to execute one or more computer instructions for performing the steps of the method according to any one of claims 1-8.
10. A computer-readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it is able to perform the steps of the method described in any one of claims 1-8.