CN110968549A - File storage method and device, electronic equipment and medium - Google Patents

File storage method and device, electronic equipment and medium Download PDF

Info

Publication number
CN110968549A
CN110968549A CN201911124975.4A CN201911124975A CN110968549A CN 110968549 A CN110968549 A CN 110968549A CN 201911124975 A CN201911124975 A CN 201911124975A CN 110968549 A CN110968549 A CN 110968549A
Authority
CN
China
Prior art keywords
offset
target file
file
identifier
storage area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201911124975.4A
Other languages
Chinese (zh)
Other versions
CN110968549B (en
Inventor
黄哲东
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Oppo Chongqing Intelligent Technology Co Ltd
Original Assignee
Oppo Chongqing Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo Chongqing Intelligent Technology Co Ltd filed Critical Oppo Chongqing Intelligent Technology Co Ltd
Priority to CN201911124975.4A priority Critical patent/CN110968549B/en
Publication of CN110968549A publication Critical patent/CN110968549A/en
Application granted granted Critical
Publication of CN110968549B publication Critical patent/CN110968549B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The application discloses a file storage method and device, electronic equipment and a medium. In the application, after the target file and the first identifier corresponding to the target file are obtained, a first offset and a second offset generated based on the first offset and the data size of the target file may be generated based on the target file, and the target file is stored in the first storage area by using the first offset, the second offset and the first identifier. By applying the technical scheme of the application, after the target file is obtained, the corresponding first offset and the second offset are generated according to the data size of the target file, and after the target file is shifted by using the two offsets, the shifted target file is stored. And further, the risk that the target file is directly stored in the related technology and is easily stolen by a malicious user can be avoided.

Description

File storage method and device, electronic equipment and medium
Technical Field
The present application relates to data processing technologies, and in particular, to a method, an apparatus, an electronic device, and a medium for storing a file.
Background
Due to the rise of the communications era and society, mobile terminals have been continuously developed with the use of more and more users.
Generally, a user can implement various functions using a mobile terminal. Such as playing games, browsing news, etc. For example, when a user wants to open a game, the terminal is usually required to find a resource file corresponding to the game in the background. And loads it to run the game for the user to operate.
However, the file storage mode existing in the related art is relatively simple, and is easily stolen and plagiarized by a malicious user, so that the user data security is at risk.
Disclosure of Invention
The embodiment of the application provides a file storage method and device, electronic equipment and a medium.
According to an aspect of an embodiment of the present application, there is provided a file storage method, including:
acquiring a target file and a first identifier, wherein the first identifier corresponds to the target file, and the target file is binary data;
generating a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file;
and storing the target file to a first storage area by using the first offset, the second offset and the first identifier.
According to another aspect of the embodiments of the present application, there is provided an apparatus for storing a file, including:
an acquisition module configured to acquire a target file and a first identifier, the first identifier corresponding to the target file, the target file being binary data;
a generating module configured to generate a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file;
and the storage module is used for storing the target file to a first storage area by utilizing the first offset, the second offset and the first identifier.
According to another aspect of the embodiments of the present application, there is provided an electronic device including:
a memory for storing executable instructions; and
a display for displaying with the memory to execute the executable instructions to perform the operations of any of the above-described file storage methods.
According to a further aspect of the embodiments of the present application, there is provided a computer-readable storage medium for storing computer-readable instructions, which when executed perform the operations of any of the above-mentioned file storage methods.
In the application, after the target file and the first identifier corresponding to the target file are obtained, a first offset and a second offset generated based on the first offset and the data size of the target file may be generated based on the target file, and the target file is stored in the first storage area by using the first offset, the second offset and the first identifier. By applying the technical scheme of the application, after the target file is obtained, the corresponding first offset and the second offset are generated according to the data size of the target file, and after the target file is shifted by using the two offsets, the shifted target file is stored. And further, the risk that the target file is directly stored in the related technology and is easily stolen by a malicious user can be avoided.
The technical solution of the present application is further described in detail by the accompanying drawings and examples.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description, serve to explain the principles of the application.
The present application may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
FIG. 1 is a schematic diagram of a system architecture proposed in the present application;
FIG. 2 is a schematic diagram of a file storage method proposed in the present application;
FIG. 3 is a schematic diagram of a file storage method proposed in the present application;
FIG. 4 is a schematic flow chart of file storage proposed in the present application;
FIG. 5 is a schematic diagram of a device for storing a file according to the present application;
fig. 6 is a schematic view of an electronic device according to the present application.
Detailed Description
Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present application unless specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the application, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
In addition, technical solutions between the various embodiments of the present application may be combined with each other, but it must be based on the realization of the technical solutions by a person skilled in the art, and when the technical solutions are contradictory or cannot be realized, such a combination of technical solutions should be considered to be absent and not within the protection scope of the present application.
It should be noted that all the directional indicators (such as upper, lower, left, right, front and rear … …) in the embodiment of the present application are only used to explain the relative position relationship between the components, the motion situation, etc. in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indicator is changed accordingly.
A method for file storage according to an exemplary embodiment of the present application is described below in conjunction with fig. 1-4. It should be noted that the following application scenarios are merely illustrated for the convenience of understanding the spirit and principles of the present application, and the embodiments of the present application are not limited in this respect. Rather, embodiments of the present application may be applied to any scenario where applicable.
Fig. 1 shows a schematic diagram of an exemplary system architecture 100 to which a video processing method or a video processing apparatus of an embodiment of the present application may be applied.
As shown in fig. 1, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. For example, server 105 may be a server cluster comprised of multiple servers, or the like.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may be various electronic devices having a display screen, including but not limited to smart phones, tablet computers, portable computers, desktop computers, and the like.
The terminal apparatuses 101, 102, 103 in the present application may be terminal apparatuses that provide various services. For example, a user obtains an object file and a first identifier through a terminal device 103 (which may also be the terminal device 101 or 102), where the first identifier corresponds to the object file, and the object file is binary data; generating a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file; and storing the target file to a first storage area by using the first offset, the second offset and the first identifier.
It should be noted that the video processing method provided in the embodiments of the present application may be executed by one or more of the terminal devices 101, 102, and 103, and/or the server 105, and accordingly, the video processing apparatus provided in the embodiments of the present application is generally disposed in the corresponding terminal device, and/or the server 105, but the present application is not limited thereto.
The application also provides a file storage method, a file storage device, a target terminal and a medium.
Fig. 2 schematically shows a flowchart of a method for storing a file according to an embodiment of the present application. As shown in fig. 2, the method includes:
s101, acquiring a target file and a first identifier, wherein the first identifier corresponds to the target file, and the target file is binary data.
It should be noted that, in the present application, a device for acquiring the target file is not specifically limited, and may be, for example, an intelligent device or a server. The intelligent device may be a PC (Personal Computer), a smart phone, a tablet Computer, an e-book reader, and an MP3(Moving Picture Experts Group audio layer iii) file storage device. MP4(Moving picture expert group Audio Layer IV) file storage device, or a portable terminal device such as a portable computer having a display function, etc.
Wherein, the target document is not limited in the application. For example, the target file may be a file of a game category, the target file may be a file of another application category, and so on. The specific changes to the target file do not affect the scope of the present application.
In addition, the first identifier of the target file is also not specifically limited in this application, for example, the first identifier may be a name corresponding to the target file, and the first identifier may also be producer information corresponding to the target file, and the like.
It should be noted that the object file in the present application may be binary data. The binary data is a number represented by two digital numbers of 0 and 1. Its cardinality is 2, the carry rule is "go one by two", and the borrow rule is "borrow one as two". Further, current computer systems use essentially binary systems, where data is stored primarily in complementary form. The binary in the computer is a very tiny switch, which is "on" for 1 and "off" for 0.
S102, generating a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file.
Further, after the target file is acquired, the risk that the target file is easily stolen and tampered by a malicious user due to direct storage of the target file in the related technology is avoided. In the application, the corresponding first offset and the second offset need to be generated according to the target file, so that the target file is shifted according to the two offsets subsequently.
First, it should be noted that the first offset is not specifically limited in the present application, and may be an offset of any byte, for example. In addition, the second offset is not specifically limited in the present application, and may be an offset of any byte. It should be noted that, the difference between the first offset and the second offset is not specifically limited in the present application. In a possible implementation manner, the difference between the first offset and the second offset may be generated according to the data size of the target file. It will be appreciated that the second offset is the offset generated by adding the difference to the first offset.
The first offset may be a start offset, and the second offset may be an end offset. For example, the offset is 5 bytes as an example: when an object file is stored at addresses 0F 00H-0F 0FH of the terminal hard disk, the file data has 16 bytes in total. Where 0F00H is the start address and the address shifted forward by 05H bytes from the start address is 0F 05H. It is understood that 0F05H is the offset address and 05H is the offset. It should be noted that, in the present application, the offset may be used to offset the target file forward, or offset the target file backward. That is, in the present application, the target file may be subjected to addition, subtraction, and offset.
S103, storing the target file to a first storage area by using the first offset, the second offset and the first identifier.
In the application, after the first offset and the second offset corresponding to the target file are generated, the two offsets and the corresponding first identifier may be subjected to relational mapping, and the target file is stored in the first storage area by using the mapping relation.
It should be noted that the first storage area is not specifically limited in this application, that is, the first storage area may be any storage location.
In the application, after the target file and the first identifier corresponding to the target file are obtained, a first offset and a second offset generated based on the first offset and the data size of the target file may be generated based on the target file, and the target file is stored in the first storage area by using the first offset, the second offset and the first identifier. By applying the technical scheme of the application, after the target file is obtained, the corresponding first offset and the second offset are generated according to the data size of the target file, and after the target file is shifted by using the two offsets, the shifted target file is stored. And further, the risk that the target file is directly stored in the related technology and is easily stolen by a malicious user can be avoided.
Optionally, in one possible implementation manner of the present application, in the present application S102 (generating the first offset and the second offset based on the target file), the following steps may be implemented:
and detecting whether a third offset exists or not, wherein the third offset is an offset corresponding to the first file, and the first file is a file which is stored in the first storage area before the target file is acquired.
Further, before generating the second offset of the target file, the present application may first detect whether a third offset exists at the first storage area. Wherein the third offset may correspond to the first file in the first storage area. It should be noted that the first file may be a file stored at the first storage area, and stored at the last time except for the target file.
For example, when the target file is a second file stored in the storage area (first storage area), the first file is a first file stored in the storage area (first storage area) by the user. Similarly, if the target file is the first file stored in the storage area (first storage area), it indicates that there is no first file, in other words, there is no third offset.
Optionally, in the process of detecting whether the third offset exists, the following two situations may be included:
in the first case:
when it is determined that the third offset amount exists, the first offset amount and the second offset amount are generated based on the third offset amount.
Further, in the process of generating the first offset and the second offset in the present application, the following steps may be performed:
taking the third offset as the first offset;
detecting the data size of the target file, and acquiring the number of bytes corresponding to the target file based on the data size of the target file;
and generating a second offset based on the first offset and the byte number corresponding to the target file.
In addition, the third offset in the present application may be an ending offset of the first file. It is understood that, for the first storage area, for example, the first file is a first file stored in the storage area by the user, and the target file is a second file stored in the storage area. It will be appreciated that for a first file, it is also provided with a start offset and an end offset for it, and that the first file is stored in the first storage area with a corresponding start offset and end offset between them. It can be understood that, when the third offset is the ending offset corresponding to the first file, the third offset may be the starting offset (the first offset) of the target file, so that the target file may be stored behind the address corresponding to the first file, which is convenient for the user to search in the later period.
For example, the first file is a first file stored in the storage area by the user, the target file is a second file stored in the storage area, and the number of bytes corresponding to the target file is 10: the first file may have a corresponding start offset of 0 and a corresponding end offset (third offset) of 0F10H, and it is understood that the binary data of the first file is stored in the first storage area between the character addresses of 0-0F 10H. For the destination file, 0F10H (third offset) can be used as the starting offset (first offset) of the destination file, that is, the binary data corresponding to the destination file can be stored in the first storage area between 0F10H (first offset) and 0F20H (second offset).
Further optionally, in the process of generating the second offset based on the first offset and the number of bytes corresponding to the target file, the method may further include:
acquiring a parameter label corresponding to a target file, wherein the parameter label comprises at least one of a service type and a file name of the target file;
and generating a second offset according to the first offset, the byte number corresponding to the target file and the parameter label.
Further, in the process of generating the second offset, in addition to the above-mentioned generation factor that may be according to the first offset and the number of bytes corresponding to the target file, the present application may also use the service type and the file name of the target file as a factor for generating the second offset. The service type of the target file is not specifically limited in the present application, and may be, for example, a file corresponding to a game class, a file corresponding to a communication class, or the like. In addition, the present application also does not specifically limit the file name, and for example, the file name may be a file name set by a user, a file name labeled by a developer, or the like.
For example, the first storage area includes a first partition (1F) and a second partition (2F), the target file is a first file stored in the storage area, and the number of bytes corresponding to the target file is 10: firstly, after the target file is obtained, the target file can be further analyzed, and after the corresponding service type is the service type of the game class, the service type can be stored in the first partition belonging to the game service. And the corresponding start offset (first offset) of the destination file may be 0, and the corresponding end offset (second offset) of the destination file is 1F10H, it can be understood that the binary data of the destination file is stored between addresses 0-1F10H in the first storage area. Further, after the target file is analyzed and the service type corresponding to the target file is obtained as the service type of the communication class, the target file can be stored in a second partition belonging to the game service. And the corresponding start offset (first offset) of the destination file may be 0, and the corresponding end offset (second offset) of the destination file is 2F10H, it can be understood that the binary data of the destination file is stored between addresses 0-2F10H in the first storage area.
In the second case:
when it is determined that the third offset amount does not exist, the first offset amount is set to a preset threshold value.
Further, when the application detects that the target file is the first file stored in the first storage area, it indicates that the first file does not exist, in other words, the third offset does not exist. It can be understood that the application may set the first offset to the default preset threshold. The preset threshold is not specifically limited in the present application, and may be, for example, 0, or 1.
Optionally, in a possible implementation manner of the present application, in S103 (storing the target file in the first storage area by using the first offset, the second offset, and the first identifier), the following steps may be implemented:
according to the first offset and the second offset, carrying out shifting operation on the target file to obtain a shifted target file;
establishing a first mapping relation of the first offset, the second offset and the first identifier;
and encrypting the shifted target file in a preset mode and storing the encrypted target file in a first storage area, and storing the first mapping relation in a second storage area.
Further, after the second offset is generated, in order to improve convenience of subsequent target file searching, the mapping relationship among the first offset, the second offset and the first identifier may be further established. And storing the mapping relationship in a second storage area. When the target file is searched subsequently, after the first identifier is acquired according to the mapping relationship, the offset corresponding to the target file is searched by using the mapping relationship, so that the storage address corresponding to the target file in the first storage area is obtained. And then the target file is obtained.
It should be noted that, in the present application, the second storage area is not specifically limited, for example, the second storage area may be the same area as the first storage area, and the second storage area may also be different area from the first storage area. In one possible embodiment, the second storage area may be a different storage area than the first storage area. So that the device acquires the target file from the first storage area after passing the authentication in the second storage area to obtain the first mapping relation.
Further, the preset mode is not specifically limited in this application. In a possible implementation manner, the target file can be encrypted by using an exclusive-or encryption algorithm and then stored in the first storage area. The XOR encryption algorithm is a binary-based bit operation strategy in a computer programming language. It may be encrypted with each character of the text run by bitwise exclusive-or with a given key. Further, if decryption is required, only bitwise exclusive-or operation needs to be performed on the encrypted result and the secret key again.
Optionally, in a possible implementation manner of the present application, after the present application S103 (storing the target file in the first storage area by using the first offset, the second offset, and the first identifier), a file storage method is further included, as shown in fig. 3, including:
s201, acquiring a target file and a first identifier.
S202, generating a first offset and a second offset based on the target file.
S203, storing the target file to a first storage area by using the first offset, the second offset and the first identifier.
S204, when a query instruction is received, the first identifier is obtained, and the query instruction is used for obtaining the target file.
In the application, after the target file is stored in the first storage area and the first mapping relation is stored in the second storage area, a query instruction for calling the target file can be waited. Further, after the query instruction is obtained, the first identifier corresponding to the target file may be obtained. It is understood that the first identifier is a storage address for querying the target file.
The method for acquiring the first identifier is not specifically limited in the present application, and for example, the first identifier may be carried in the query instruction. Or, the first identifier may also be stored in a preset database, and after receiving the query instruction, the device may send the database access address in which the first identifier is stored to the user, so that the user can correspondingly obtain the first identifier.
S205, when the authentication passing message is detected, the first mapping relation is obtained from the second storage area by using the first identifier.
In the application, when the user acquires the first mapping relationship from the second storage area by using the first identifier, the disadvantage that the user experience is affected due to the fact that the first mapping relationship is stolen by a malicious user is avoided. The method and the device for obtaining the first mapping relation can authenticate the device for obtaining the first mapping relation. And only when the message passing the authentication is received, the first mapping relation is allowed to be acquired from the second storage area.
The present application does not specifically limit the authentication method. For example, it may be authenticated by means of a random authentication code. Or authentication by using a preset exclusive-or encryption algorithm, etc. It is understood that the scope of the present application is not affected by the variation of the authentication method.
S206, based on the first mapping relation, a first offset and a second offset are obtained.
S207, reading binary data of the first storage area with the address between the first offset and the second offset in a binary mode to obtain the target file.
Further, after the mapping relationship is obtained, the corresponding first offset and second offset can be obtained by using the first identifier. It will be appreciated that the address at which the target file is stored in the first storage area is between two offsets. Therefore, corresponding binary data can be read between the addresses of the first storage area to obtain the corresponding target file.
Further, fig. 4 is taken as an example to further illustrate: after the target file and the corresponding first identifier are obtained, whether a third offset exists can be further detected. And after determining that the third offset amount exists, regarding the third offset amount as the first offset amount. And detecting the data size of the target file, and acquiring the byte number corresponding to the target file based on the data size of the target file. And then, generating a second offset according to the first offset and the byte number corresponding to the target file. Furthermore, according to the application, the target file can be shifted according to the first offset and the second offset, so that after the shifted target file is obtained, the shifted target file is encrypted in a preset mode and then stored in the first storage area, and meanwhile, the first mapping relation is stored in the second storage area. To wait for a subsequent query instruction to call the target file. In addition, after the third offset amount is determined not to exist, the first offset amount may be set as a preset threshold.
In the application, after the target file and the first identifier corresponding to the target file are obtained, a first offset and a second offset generated based on the first offset and the data size of the target file may be generated based on the target file, and the target file is stored in the first storage area by using the first offset, the second offset and the first identifier. By applying the technical scheme of the application, after the target file is obtained, the corresponding first offset and the second offset are generated according to the data size of the target file, and after the target file is shifted by using the two offsets, the shifted target file is stored. And further, the risk that the target file is directly stored in the related technology and is easily stolen by a malicious user can be avoided.
In another embodiment of the present application, as shown in fig. 5, the present application further provides a file storage apparatus. The device comprises an acquisition module 301, a generation module 302 and a storage module 303, wherein:
an obtaining module 301 configured to obtain a target file and a first identifier, where the first identifier corresponds to the target file and the target file is binary data;
a generating module 302 configured to generate a first offset and a second offset based on the target file, where the second offset is an offset generated based on the first offset and the data size of the target file;
the storage module 303 is configured to store the target file in a first storage area by using the first offset, the second offset, and the first identifier.
In the application, after the target file and the first identifier corresponding to the target file are obtained, a first offset and a second offset generated based on the first offset and the data size of the target file may be generated based on the target file, and the target file is stored in the first storage area by using the first offset, the second offset and the first identifier. By applying the technical scheme of the application, after the target file is obtained, the corresponding first offset and the second offset are generated according to the data size of the target file, and after the target file is shifted by using the two offsets, the shifted target file is stored. And further, the risk that the target file is directly stored in the related technology and is easily stolen by a malicious user can be avoided.
In another embodiment of the present application, the generating module 302 further includes:
a generating module 302, configured to detect whether a third offset exists, where the third offset is an offset corresponding to a first file, and the first file is a file that is stored in the first storage area most recently before the acquisition target file;
a generating module 302 configured to generate the first offset and the second offset based on the third offset when it is determined that the third offset exists.
In another embodiment of the present application, the generating module 302 further includes:
a generating module 302 configured to take the third offset as the first offset;
a generating module 302, configured to detect the data size of the target file, and obtain the number of bytes corresponding to the target file based on the data size of the target file;
a generating module 302 configured to generate the second offset based on the first offset and a number of bytes corresponding to the target file.
In another embodiment of the present application, the method further includes a generating module 302, wherein:
a generating module 302, configured to obtain a parameter tag corresponding to the target file, where the parameter tag includes at least one of a service type and a file name of the target file;
a generating module 302, configured to generate the second offset according to the first offset, the number of bytes corresponding to the target file, and the parameter tag.
In another embodiment of the present application, the storage module 303 further includes:
a storage module 303, configured to perform a shift operation on the target file according to the first offset and the second offset to obtain the shifted target file;
a storage module 303 configured to establish a first mapping relationship between the first offset, the second offset, and the first identifier;
a storage module 303, configured to encrypt the shifted target file in a preset manner and store the encrypted target file in the first storage area, and store the first mapping relationship in a second storage area.
In another embodiment of the present application, the method further includes a receiving module 304, wherein:
a receiving module 304, configured to, when receiving a query instruction, obtain the first identifier, where the query instruction is used to obtain the target file;
a receiving module 304, configured to, when detecting that the authentication passes the message, obtain the first mapping relationship from the second storage area by using the first identifier;
a receiving module 304, configured to obtain the first offset and the second offset based on a first mapping relationship;
a receiving module 304, configured to read binary data in the first storage area and addressed between the first offset and the second offset in a binary manner, so as to obtain the target file.
In another embodiment of the present application, the method further includes a setting module 305, wherein:
a setting module 305 configured to set the first offset amount to a preset threshold when it is determined that the third offset amount does not exist.
FIG. 6 is a block diagram illustrating a logical structure of an electronic device in accordance with an exemplary embodiment. For example, the electronic device 400 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 6, electronic device 400 may include one or more of the following components: a processor 401 and a memory 402.
Processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, or the like. The processor 401 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor, where the main processor is a processor for processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 401 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in the memory 402 is configured to store at least one instruction for execution by the processor 401 to implement the interactive special effect calibration method provided by the method embodiments of the present application.
In some embodiments, the electronic device 400 may further optionally include: a peripheral interface 403 and at least one peripheral. The processor 401, memory 402 and peripheral interface 403 may be connected by bus or signal lines. Each peripheral may be connected to the peripheral interface 403 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 404, touch screen display 405, camera 406, audio circuitry 407, positioning components 408, and power supply 409.
The peripheral interface 403 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 401 and the memory 402. In some embodiments, processor 401, memory 402, and peripheral interface 403 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 401, the memory 402 and the peripheral interface 403 may be implemented on a separate chip or circuit board, which is not limited by this embodiment.
The Radio Frequency circuit 404 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 404 communicates with communication networks and other communication devices via electromagnetic signals. The rf circuit 404 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 404 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuitry 404 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: metropolitan area networks, various generation mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 404 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 405 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 405 is a touch display screen, the display screen 405 also has the ability to capture touch signals on or over the surface of the display screen 405. The touch signal may be input to the processor 401 as a control signal for processing. At this point, the display screen 405 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display screen 405 may be one, providing the front panel of the electronic device 400; in other embodiments, the display screen 405 may be at least two, respectively disposed on different surfaces of the electronic device 400 or in a folded design; in still other embodiments, the display screen 405 may be a flexible display screen disposed on a curved surface or a folded surface of the electronic device 400. Even further, the display screen 405 may be arranged in a non-rectangular irregular pattern, i.e. a shaped screen. The Display screen 405 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 406 is used to capture images or video. Optionally, camera assembly 406 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 406 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuit 407 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 401 for processing, or inputting the electric signals to the radio frequency circuit 404 for realizing voice communication. For stereo capture or noise reduction purposes, the microphones may be multiple and disposed at different locations of the electronic device 400. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 401 or the radio frequency circuit 404 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuitry 407 may also include a headphone jack.
The positioning component 408 is used to locate a current geographic location of the electronic device 400 to implement navigation or LBS (location based Service). The positioning component 408 may be a positioning component based on the GPS (global positioning System) of the united states, the beidou System of china, the graves System of russia, or the galileo System of the european union.
The power supply 409 is used to supply power to the various components in the electronic device 400. The power source 409 may be alternating current, direct current, disposable or rechargeable. When power source 409 comprises a rechargeable battery, the rechargeable battery may support wired or wireless charging. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, the electronic device 400 also includes one or more sensors 410. The one or more sensors 410 include, but are not limited to: acceleration sensor 411, gyro sensor 412, pressure sensor 413, fingerprint sensor 414, optical sensor 415, and proximity sensor 416.
The acceleration sensor 411 may detect the magnitude of acceleration in three coordinate axes of a coordinate system established with the electronic apparatus 400. For example, the acceleration sensor 411 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 401 may control the touch display screen 405 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 411. The acceleration sensor 411 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 412 may detect a body direction and a rotation angle of the electronic device 400, and the gyro sensor 412 may cooperate with the acceleration sensor 411 to acquire a 3D motion of the user on the electronic device 400. From the data collected by the gyro sensor 412, the processor 401 may implement the following functions: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
The pressure sensors 413 may be disposed on a side bezel of the electronic device 400 and/or on a lower layer of the touch display screen 405. When the pressure sensor 413 is arranged on the side frame of the electronic device 400, a holding signal of the user to the electronic device 400 can be detected, and the processor 401 performs left-right hand identification or shortcut operation according to the holding signal collected by the pressure sensor 413. When the pressure sensor 413 is disposed at the lower layer of the touch display screen 405, the processor 401 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 405. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 414 is used for collecting a fingerprint of the user, and the processor 401 identifies the identity of the user according to the fingerprint collected by the fingerprint sensor 414, or the fingerprint sensor 414 identifies the identity of the user according to the collected fingerprint. Upon identifying that the user's identity is a trusted identity, processor 401 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, file storage, and changing settings, etc. The fingerprint sensor 414 may be disposed on the front, back, or side of the electronic device 400. When a physical button or vendor Logo is provided on the electronic device 400, the fingerprint sensor 414 may be integrated with the physical button or vendor Logo.
The optical sensor 415 is used to collect the ambient light intensity. In one embodiment, the processor 401 may control the display brightness of the touch display screen 405 based on the ambient light intensity collected by the optical sensor 415. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 405 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 405 is turned down. In another embodiment, the processor 401 may also dynamically adjust the shooting parameters of the camera assembly 406 according to the ambient light intensity collected by the optical sensor 415.
Proximity sensor 416, also known as a distance sensor, is typically disposed on the front panel of electronic device 400. The proximity sensor 416 is used to capture the distance between the user and the front of the electronic device 400. In one embodiment, the processor 401 controls the touch display screen 405 to switch from the bright screen state to the dark screen state when the proximity sensor 416 detects that the distance between the user and the front surface of the electronic device 400 gradually decreases; when the proximity sensor 416 detects that the distance between the user and the front of the electronic device 400 is gradually increased, the processor 401 controls the touch display screen 405 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 6 does not constitute a limitation of the electronic device 400, and may include more or fewer components than those shown, or combine certain components, or employ a different arrangement of components.
In an exemplary embodiment, there is also provided a non-transitory computer-readable storage medium, such as the memory 404, comprising instructions executable by the processor 420 of the electronic device 400 to perform a method of file storage as described above, the method comprising: acquiring a target file and a first identifier, wherein the first identifier corresponds to the target file, and the target file is binary data; generating a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file; and storing the target file to a first storage area by using the first offset, the second offset and the first identifier. Optionally, the instructions may also be executable by the processor 420 of the electronic device 400 to perform other steps involved in the exemplary embodiments described above. Optionally, the instructions may also be executable by the processor 420 of the electronic device 400 to perform other steps involved in the exemplary embodiments described above. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, there is also provided an application/computer program product comprising one or more instructions executable by the processor 420 of the electronic device 400 to perform the above-described method of file storage, the method comprising: acquiring a target file and a first identifier, wherein the first identifier corresponds to the target file, and the target file is binary data; generating a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file; and storing the target file to a first storage area by using the first offset, the second offset and the first identifier. Optionally, the instructions may also be executable by the processor 420 of the electronic device 400 to perform other steps involved in the exemplary embodiments described above. Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.

Claims (10)

1. A method of file storage, comprising:
acquiring a target file and a first identifier, wherein the first identifier corresponds to the target file, and the target file is binary data;
generating a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file;
and storing the target file to a first storage area by using the first offset, the second offset and the first identifier.
2. The method of claim 1, wherein generating a first offset and a second offset based on the target file comprises:
detecting whether a third offset exists, wherein the third offset is an offset corresponding to a first file, and the first file is a file which is stored in the first storage area before the target file is obtained;
when it is determined that the third offset amount exists, the first offset amount and the second offset amount are generated based on the third offset amount.
3. The method of claim 2, wherein the generating the first offset and the second offset based on the third offset comprises:
taking the third offset as the first offset;
detecting the data size of the target file, and acquiring the number of bytes corresponding to the target file based on the data size of the target file;
and generating the second offset based on the first offset and the number of bytes corresponding to the target file.
4. The method of claim 3, wherein generating the second offset based on the first offset and a number of bytes corresponding to the target file comprises:
acquiring a parameter label corresponding to the target file, wherein the parameter label comprises at least one of a service type and a file name of the target file;
and generating the second offset according to the first offset, the byte number corresponding to the target file and the parameter label.
5. The method of claim 3 or 4, wherein storing the target file to a first storage area using the first offset, the second offset, and the first identifier comprises:
according to the first offset and the second offset, carrying out shifting operation on the target file to obtain the shifted target file;
establishing a first mapping relation among the first offset, the second offset and the first identifier;
and encrypting the shifted target file in a preset mode and storing the encrypted target file in the first storage area, and storing the first mapping relation in a second storage area.
6. The method of claim 5, wherein after said storing the second file to the first storage area, comprising:
when a query instruction is received, acquiring the first identifier, wherein the query instruction is used for acquiring the target file;
when the authentication passing message is detected, the first mapping relation is acquired from the second storage area by using the first identifier;
acquiring the first offset and the second offset based on a first mapping relation;
and reading binary data with addresses between the first offset and the second offset in the first storage area in a binary mode to obtain the target file.
7. The method of claim 2, wherein after said detecting whether the third offset is present, comprising:
when it is determined that the third offset amount does not exist, setting the first offset amount to a preset threshold value.
8. An apparatus for file storage, comprising:
an acquisition module configured to acquire a target file and a first identifier, the first identifier corresponding to the target file, the target file being binary data;
a generating module configured to generate a first offset and a second offset based on the target file, wherein the second offset is an offset generated based on the first offset and the data size of the target file;
and the storage module is used for storing the target file to a first storage area by utilizing the first offset, the second offset and the first identifier.
9. An electronic device, comprising:
a memory for storing executable instructions; and the number of the first and second groups,
a processor for display with the memory to execute the executable instructions to perform the operations of the method of file storage of any of claims 1-7.
10. A computer-readable storage medium storing computer-readable instructions that, when executed, perform operations of the method of file storage of any of claims 1-7.
CN201911124975.4A 2019-11-18 2019-11-18 File storage method, device, electronic equipment and medium Active CN110968549B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911124975.4A CN110968549B (en) 2019-11-18 2019-11-18 File storage method, device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911124975.4A CN110968549B (en) 2019-11-18 2019-11-18 File storage method, device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN110968549A true CN110968549A (en) 2020-04-07
CN110968549B CN110968549B (en) 2024-03-29

Family

ID=70030781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911124975.4A Active CN110968549B (en) 2019-11-18 2019-11-18 File storage method, device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN110968549B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897487A (en) * 2020-06-15 2020-11-06 北京瀚诺半导体科技有限公司 Method, apparatus, electronic device and medium for managing data

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266037A1 (en) * 2004-11-05 2007-11-15 Data Robotics Incorporated Filesystem-Aware Block Storage System, Apparatus, and Method
KR20120064365A (en) * 2010-12-09 2012-06-19 한국전자통신연구원 Apparatus and method for changing data
CN102695024A (en) * 2011-03-21 2012-09-26 鸿富锦精密工业(深圳)有限公司 Front-end recording system of network video recorder, and method therefor
CN102902687A (en) * 2011-07-27 2013-01-30 华为软件技术有限公司 Accessing method and device of resource file
CN103034642A (en) * 2011-09-30 2013-04-10 高德软件有限公司 Data file generating method, application program, data downloading system and data downloading method
CN104166810A (en) * 2014-07-29 2014-11-26 苏州乐米信息科技有限公司 Encryption method for mobile phone game software
CN104462563A (en) * 2014-12-26 2015-03-25 浙江宇视科技有限公司 File storage method and system
CN104572670A (en) * 2013-10-15 2015-04-29 方正国际软件(北京)有限公司 Small file storage, query and deletion method and system
CN105205153A (en) * 2015-09-24 2015-12-30 小米科技有限责任公司 File storage method and device
CN105302883A (en) * 2015-10-13 2016-02-03 深圳市乐唯科技开发有限公司 Time-based media file management method and system
CN106339473A (en) * 2016-08-29 2017-01-18 北京百度网讯科技有限公司 Method and device for copying file
WO2017177752A1 (en) * 2016-04-14 2017-10-19 杭州海康威视数字技术股份有限公司 File storage method and device
CN109213497A (en) * 2017-06-30 2019-01-15 武汉斗鱼网络科技有限公司 A kind of moving game channel packet generation method and device
CN109582653A (en) * 2018-11-14 2019-04-05 网易(杭州)网络有限公司 Compression, decompression method and the equipment of file

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070266037A1 (en) * 2004-11-05 2007-11-15 Data Robotics Incorporated Filesystem-Aware Block Storage System, Apparatus, and Method
KR20120064365A (en) * 2010-12-09 2012-06-19 한국전자통신연구원 Apparatus and method for changing data
CN102695024A (en) * 2011-03-21 2012-09-26 鸿富锦精密工业(深圳)有限公司 Front-end recording system of network video recorder, and method therefor
CN102902687A (en) * 2011-07-27 2013-01-30 华为软件技术有限公司 Accessing method and device of resource file
CN103034642A (en) * 2011-09-30 2013-04-10 高德软件有限公司 Data file generating method, application program, data downloading system and data downloading method
CN104572670A (en) * 2013-10-15 2015-04-29 方正国际软件(北京)有限公司 Small file storage, query and deletion method and system
CN104166810A (en) * 2014-07-29 2014-11-26 苏州乐米信息科技有限公司 Encryption method for mobile phone game software
CN104462563A (en) * 2014-12-26 2015-03-25 浙江宇视科技有限公司 File storage method and system
CN105205153A (en) * 2015-09-24 2015-12-30 小米科技有限责任公司 File storage method and device
CN105302883A (en) * 2015-10-13 2016-02-03 深圳市乐唯科技开发有限公司 Time-based media file management method and system
WO2017177752A1 (en) * 2016-04-14 2017-10-19 杭州海康威视数字技术股份有限公司 File storage method and device
CN106339473A (en) * 2016-08-29 2017-01-18 北京百度网讯科技有限公司 Method and device for copying file
CN109213497A (en) * 2017-06-30 2019-01-15 武汉斗鱼网络科技有限公司 A kind of moving game channel packet generation method and device
CN109582653A (en) * 2018-11-14 2019-04-05 网易(杭州)网络有限公司 Compression, decompression method and the equipment of file

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
任献彬等: "数据加密技术在嵌入式系统中的应用", 《现代电子技术》, vol. 35, no. 22, pages 7 - 9 *
余艳等: "软件安全性设计方法概述", 《信息系统工程》 *
余艳等: "软件安全性设计方法概述", 《信息系统工程》, no. 11, 20 November 2010 (2010-11-20), pages 49 - 50 *
孙秀丽;: "刀片加密服务器的文件加脱密技术", 计算机科学, no. 04, pages 83 - 85 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897487A (en) * 2020-06-15 2020-11-06 北京瀚诺半导体科技有限公司 Method, apparatus, electronic device and medium for managing data
CN111897487B (en) * 2020-06-15 2023-08-18 北京瀚诺半导体科技有限公司 Method, device, electronic equipment and medium for managing data

Also Published As

Publication number Publication date
CN110968549B (en) 2024-03-29

Similar Documents

Publication Publication Date Title
CN108833607B (en) Physical address acquisition method, device and readable medium
CN110290146B (en) Method and device for generating shared password, server and storage medium
CN110851823B (en) Data access method, device, terminal and storage medium
CN111159604A (en) Picture resource loading method and device
CN111193702B (en) Method and device for data encryption transmission
CN110290191B (en) Resource transfer result processing method, device, server, terminal and storage medium
CN110784370B (en) Method and device for testing equipment, electronic equipment and medium
CN111901283A (en) Resource transfer method, device, terminal and storage medium
CN109033473B (en) Picture sharing method and device and computer readable storage medium
CN110968549B (en) File storage method, device, electronic equipment and medium
CN111881423A (en) Method, device and system for limiting function use authorization
CN111198922A (en) Game resource management method and device based on block chain
CN110597840A (en) Partner relationship establishing method, device, equipment and storage medium based on block chain
CN111158780B (en) Method, device, electronic equipment and medium for storing application data
CN113836426A (en) Information pushing method and device and electronic equipment
CN113076452A (en) Application classification method, device, equipment and computer readable storage medium
CN111680039A (en) Storage method, query method, device, equipment and storage medium of order information
CN111010732A (en) Network registration method, device, electronic equipment and medium
CN111125095A (en) Data prefix adding method and device, electronic equipment and medium
CN111191254A (en) Access verification method and device, computer equipment and storage medium
CN111007969B (en) Method, device, electronic equipment and medium for searching application
CN112995159B (en) Information processing method, device, terminal and computer readable storage medium
CN111586891B (en) Network connection method, device, electronic equipment and medium
CN113746831B (en) Authority verification method and device and storage medium
CN111049970B (en) Method and device for operating equipment, electronic equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant