[go: up one dir, main page]

WO2023011388A1 - Memory sharing method and apparatus, electronic device, and readable storage medium - Google Patents

Memory sharing method and apparatus, electronic device, and readable storage medium Download PDF

Info

Publication number
WO2023011388A1
WO2023011388A1 PCT/CN2022/109319 CN2022109319W WO2023011388A1 WO 2023011388 A1 WO2023011388 A1 WO 2023011388A1 CN 2022109319 W CN2022109319 W CN 2022109319W WO 2023011388 A1 WO2023011388 A1 WO 2023011388A1
Authority
WO
WIPO (PCT)
Prior art keywords
target data
memory
memory space
data
server
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.)
Ceased
Application number
PCT/CN2022/109319
Other languages
French (fr)
Chinese (zh)
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.)
Individual
Original Assignee
Individual
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 Individual filed Critical Individual
Publication of WO2023011388A1 publication Critical patent/WO2023011388A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory

Definitions

  • the present invention relates to the technical field of data sharing technology, in particular to a memory sharing method, device, electronic equipment and readable storage medium.
  • the embodiments of the present invention provide a memory sharing method, device, electronic equipment, and readable storage medium, so as to solve the problem that it is difficult to implement memory sharing through local operations.
  • an embodiment of the present invention provides a memory sharing method, including: acquiring target data corresponding to the server; storing the target data in memory space; when it is detected that the target data needs to be called, from the Extracting the target data from the memory space.
  • the memory sharing method stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it is detected that the target data needs to be called locally.
  • the method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation.
  • the target data can exist without the server, speeding up the local data processing process.
  • the storing the target data in the memory space includes: performing block processing on the target data to obtain multiple target data blocks; Multiple target data blocks are stored in the memory space in parallel.
  • multiple target data blocks are obtained by dividing the target data into blocks, and the multiple target data blocks are stored in parallel in the memory space, so that when the server is offline, it can be extracted from the memory space.
  • the remaining target data blocks are guaranteed to be processed locally.
  • the parallel storing of the multiple target data blocks in the memory space includes: acquiring the occupied space of the target data; judging Whether the occupied space exceeds the preset value; when the occupied space exceeds the preset value, obtain the target number of target data blocks stored in the memory space; parallelize the target number of target data blocks stored in the memory space.
  • the memory sharing method further includes: saving the remaining target data blocks to a local file, and judging whether it is necessary to call the the target data block; when the target data block in the local file needs to be called, the target data block is extracted to the memory space.
  • the memory sharing method obtaineds the target number of target data blocks stored in the memory space by obtaining the occupied space of the target data and judging that the occupied space of the target data exceeds a preset value, and stores the target number of target data blocks Parallel storage to the memory space, and save the remaining target data blocks to local files, thereby avoiding excessive memory usage by the target data, and through parallel storage, multiple data analysis can be avoided, the speed of data extraction is improved, and the local Data processing speed.
  • By saving a part of the target data block to the internal memory and another part of the target data block to the local file when the target data block in the local file is needed, it is extracted to the memory, while ensuring the local data processing speed, the local data is guaranteed Handles process continuity.
  • the extracting the target data from the memory space includes: in response to a data access request, determining the target data corresponding to the data access request; Extract the target data from the memory space.
  • the method by responding to the data access request, determining the target data corresponding to the data access request, and extracting the target data from the memory space.
  • the method can provide corresponding target data based on the data access request, improves the accuracy of data extraction, and avoids the extraction of invalid data.
  • the extracting the target data from the memory space includes: obtaining a start point and an end point of data extraction; start point and the end point, and extract data between the start point and the end point from the memory space to obtain the target data.
  • the memory sharing method acquires the starting point and the ending point of data extraction, and extracts the data located between the starting point and the ending point from the memory space based on the starting point and the ending point, and obtains the target data. Accurate extraction of target data ensures the flexibility of target data extraction.
  • the acquiring the target data corresponding to the server includes: sending data request information to the server; receiving the data corresponding to the data request information sent by the server target data.
  • the memory sharing method provided by the embodiment of the present invention sends data request information to the server and receives the target data corresponding to the data request information sent by the server, so as to save all the target data in the memory space, so that it is convenient for the local Able to complete the data processing process.
  • the present invention provides a memory sharing device, comprising: an acquisition module, configured to acquire target data corresponding to a server; a storage module, configured to store the target data in a memory space; an extraction module, configured to When it is detected that the target data needs to be called, the target data is extracted from the memory space.
  • the memory sharing device stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it detects that the target data needs to be called locally.
  • the method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation. By storing the target data corresponding to the server in the memory space, the target data can exist without the server, speeding up the local data processing process.
  • the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor are connected to each other in communication, the memory stores computer instructions, and the processor executes the The computer has instructions to execute the memory sharing method described in the first aspect or any implementation manner of the first aspect.
  • the present invention provides a computer-readable storage medium, which is characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to make a computer perform the first aspect or any one of the first aspects.
  • memory sharing is realized in local operation without requesting to the server, so that target data can exist without the server, the calling speed and display speed of target data are improved, and the local data processing process is accelerated.
  • Fig. 1 is a flowchart of a memory sharing method according to an embodiment of the present invention
  • FIG. 2 is another flowchart of a memory sharing method according to an embodiment of the present invention.
  • FIG. 3 is another flowchart of a memory sharing method according to an embodiment of the present invention.
  • FIG. 4 is a structural block diagram of a memory sharing device according to an embodiment of the present invention.
  • FIG. 5 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention.
  • an embodiment of a memory sharing method is provided. It should be noted that the steps shown in the flowcharts of the drawings can be executed in a computer system such as a set of computer-executable instructions, and, although A logical order is shown in the flowcharts, but in some cases the steps shown or described may be performed in an order different from that shown or described herein.
  • FIG. 1 is a flow chart of a memory sharing method according to an embodiment of the present invention. As shown in FIG. 1 , the The process includes the following steps:
  • the target data is the running data that the electronic device locally requests from the server, and the electronic device can obtain the running data from the server in advance. For example, when the electronic device needs to install a piece of software, the electronic device can obtain software data from the server in the early stage of software installation.
  • the memory space is a local memory space of the electronic device.
  • the electronic device saves the target data it obtains from the server in the memory space.
  • the required data can be directly extracted from the memory space every time a page jump is performed without requesting the server.
  • the electronic device may divide the acquired target data into data blocks, and sequentially store the divided target data blocks into the memory space.
  • the target data is extracted from the memory space.
  • the electronic device During the data processing process of the electronic device, if it detects that it needs to obtain target data from the server, if the environment where the electronic device is located has a good network environment, it will directly download the target data from the server for use. The network environment is poor, and at this time, the electronic device can retrieve the required target data from the memory space for calling, so as to ensure that the data processing process is not interrupted. For example, when an electronic device downloads software, it needs to access the server to obtain software data. If the network is interrupted or the network signal is poor, it is difficult to jump to the page to download the software, and the corresponding software data on the server is saved to the memory space. Even if the signal is poor, the electronic device can still extract the required software data from the memory space for software installation.
  • the memory sharing method provided in this embodiment stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it is detected that the target data needs to be called locally.
  • the method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation.
  • the target data can exist without the server, speeding up the local data processing process.
  • FIG. 2 is a flow chart of a memory sharing method according to an embodiment of the present invention. As shown in FIG. 2, the The process includes the following steps:
  • step S22 may include the following steps:
  • the target data block is the data block obtained by dividing the target data.
  • the 1G target data is divided into 10 target data blocks, and there are block identifiers on the 10 target data blocks obtained by dividing, so that the electronic device can
  • the target data block required by the running process call, wherein the division of the target data may be equal or unequal. This application does not specifically limit this, and those skilled in the art can determine it according to actual needs.
  • Parallel storage means that there is no nesting relationship between each target data block, and each target data block can be extracted and called separately.
  • the electronic device After the electronic device obtains multiple target data blocks, it stores them in the memory space sequentially according to the block identifiers set in the target data blocks, so that when the electronic device calls a certain target data block, it does not need to perform nested parsing, which improves the target Data block fetch speed.
  • step S222 may include:
  • the occupied space is the space capacity required to store the target data.
  • the electronic device can analyze the attributes of the target data to determine its required space capacity, so as to allocate a suitable local storage space for it. For example, if the target data is 300M, the electronic device may allocate 300M of local storage space for the target data.
  • the preset value is the maximum storage space of the target data supported by the internal memory.
  • the electronic device can compare the relationship between the occupied space of the target data and the preset value, and determine whether the occupied space of the target data exceeds the preset value. When the occupied space of the target data exceeds the preset value, execute step (3), otherwise skip to step (5) for execution.
  • the electronic device can store part of the target data blocks in the memory space, and save the rest in local files.
  • the target number of target data blocks stored in the memory space can be determined according to the memory space. For example, there are currently 10 target data blocks (1 ⁇ 10) obtained by evenly dividing, and the memory space can only store 3 target data blocks. At this time, the electronic device may extract 1 to 3 target data blocks from the 10 target data blocks and store them in the local space. Of course, other sequences of target data blocks may also be used, which is not specifically limited here.
  • the electronic device may store a target number of target data blocks in parallel in the memory space. For example, currently there are 10 target data blocks (1-10) that are equally divided, and the electronic device may sequentially store the target data blocks 1-3 in the memory space.
  • the electronic device saves the remaining target data blocks to a local file to generate a file table. Taking 10 evenly divided target data blocks 1 ⁇ 10 as an example, after the electronic device sequentially stores target data blocks 1 ⁇ 3 into the memory space, it can save target data blocks 4 ⁇ 10 in a local file, and based on 4 to 10 target data blocks generate a file table, so as to extract the target data block corresponding to the block identifier.
  • the electronic device can detect in real time whether it needs to call the target data block in the local file. When it is detected that the electronic device needs to call the target data block in the local file, step (7) is performed; otherwise, the current data processing process is continued.
  • the electronic device can extract the corresponding target data block from the local file and extract it to the memory space.
  • the electronic device can call the target data block at any time according to its data processing process. For example, after the electronic device extracts the target data blocks 1 ⁇ 3 and completes the execution, the subsequent target data blocks are required for further execution, and at this time, the electronic device can extract other required target data blocks from the file table into the memory space, so that The target data required by the current data processing process are all stored in the memory space.
  • the target data is extracted from the memory space.
  • the relevant description of the corresponding step S13 in the above embodiment and details are not repeated here.
  • the memory sharing method provided in this embodiment obtains multiple target data blocks by dividing the target data into blocks, and stores the multiple target data blocks in parallel in the memory space, so that when the server is offline, the remaining data can be extracted from the memory space.
  • the target data block to ensure the local data processing process.
  • obtain the occupied space of the target data and judging that the occupied space of the target data exceeds the preset value obtain the target number of target data blocks stored in the memory space, store the target number of target data blocks in parallel in the memory space, and store the remaining
  • the target data block is saved to a local file, thereby preventing the target data from occupying too much memory, and through parallel storage, multiple data analysis can be avoided, the speed of data extraction is improved, and the processing speed of local data is guaranteed.
  • the target data block in the local file is needed, it is extracted to the memory, while ensuring the local data processing speed, the local data is guaranteed Handles process continuity.
  • FIG. 3 is a flow chart of the memory sharing method according to an embodiment of the present invention. As shown in FIG. 3 , the The process includes the following steps:
  • step S31 may include:
  • the data request information is used for the electronic device to request corresponding target data from the server.
  • the electronic device can send data request information to the server, and store the data in the server in the memory space, so that it can be directly extracted from the memory space when the electronic device needs it, without sending a request to the server, so it is not limited by the network environment, through Save the server data to the memory space, so that the electronic device can still directly call the data in the memory space to complete the data processing after it is separated from the server.
  • the server may send target data corresponding to the data request information to the electronic device.
  • the electronic device can receive the target data delivered by the server.
  • the target data is extracted from the memory space.
  • step S33 may include:
  • the memory of the electronic device can respond to the data access request of the electronic device for its stored data, search the corresponding target data from the memory space based on the data access request, and feed back the storage address of the target data in the memory space to the processor of the electronic device .
  • the processor of the electronic device may extract target data required for data processing from the memory space according to the storage address.
  • step S332 may include:
  • the starting point is the starting position of data extraction, that is, the starting storage address of the data to be extracted in the memory space; the ending point is the ending position of data extraction, that is, the ending storage address of the data to be extracted in the memory space.
  • the electronic device may use the movement of the pointer to determine the start point of data extraction, and then determine the length of the data to be extracted to determine the end point of data extraction. Specifically, each time the processor of the electronic device extracts data from the memory space, it can obtain the start storage address and the end storage address of the required data in the memory space.
  • the processor of the electronic device obtains the storage address, it accesses the memory space, and extracts the data between the start point and the end point from the memory space according to the starting point and end point of the data extraction obtained by it, and the data between the starting point and the end point
  • the data between the points is the target data.
  • the memory sharing method sends data request information to the server and receives the target data corresponding to the data request information sent by the server to save all the target data in the memory space, so that the local can still Complete the data processing process.
  • the method can provide corresponding target data based on the data access request, improves the accuracy of data extraction, and avoids the extraction of invalid data.
  • the target data is obtained, and the target data is guaranteed while ensuring the accurate extraction of target data extraction flexibility.
  • a memory sharing device is also provided, which is used to implement the above embodiments and preferred implementation modes, and what has already been described will not be repeated.
  • the term "module” may be a combination of software and/or hardware that realizes a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.
  • This embodiment provides a memory sharing device, as shown in Figure 4, including:
  • An acquisition module 41 configured to acquire target data corresponding to the server. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the storage module 42 is used for storing the target data in the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the extraction module 43 is configured to extract the target data from the memory space when it is detected that the target data needs to be invoked. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the memory sharing device stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it detects that the target data needs to be called locally.
  • the method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation. By storing the target data corresponding to the server in the memory space, the target data can exist without the server, speeding up the local data processing process.
  • the above-mentioned storage module 42 may include:
  • the block sub-module is used to process the target data into blocks to obtain multiple target data blocks. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.
  • the storage sub-module is used to store multiple target data blocks in parallel to the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the above-mentioned storage submodule may include:
  • the first acquiring submodule is used to acquire the occupied space of the target data.
  • the first acquiring submodule is used to acquire the occupied space of the target data.
  • the first judging sub-module is used to judge whether the occupied space exceeds a preset value. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.
  • the second obtaining sub-module is used to obtain the target number of target data blocks stored in the memory space when the occupied space exceeds a preset value.
  • the parallel storage sub-module is used for parallel storage of the target number of target data blocks into the memory space.
  • the save submodule is used to save the remaining target data blocks to local files. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.
  • the second judging submodule is used to judge whether the target data block in the local file needs to be called. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the extraction submodule is used to extract the target data block to the memory space when the target data block in the local file needs to be called. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.
  • the above-mentioned extraction module 43 may include:
  • the first response submodule is configured to determine target data corresponding to the data access request in response to the data access request.
  • the extraction submodule is used to extract target data from the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the above-mentioned extraction submodule may include:
  • the third obtaining sub-module is used to obtain the starting point and the ending point of data extraction.
  • the determining submodule is used to extract data between the starting point and the ending point from the memory space based on the starting point and the ending point to obtain target data.
  • the acquisition module 41 may include:
  • the sending sub-module is used to send data request information to the server. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.
  • the receiving sub-module is used to receive the target data corresponding to the data request information issued by the server. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.
  • the memory sharing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and/or other devices that can provide the above functions .
  • An embodiment of the present invention also provides an electronic device, which has the memory sharing device shown in FIG. 4 .
  • FIG. 5 is a schematic structural diagram of an electronic device provided in an optional embodiment of the present invention.
  • the electronic device may include: at least one processor 501, such as a CPU (Central Processing Unit, central processing unit), at least one communication interface 503, memory 504, and at least one communication bus 502.
  • the communication bus 502 is used to realize connection and communication between these components.
  • the communication interface 503 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 503 may also include a standard wired interface and a wireless interface.
  • Memory 504 can be a high-speed RAM memory (Random Access Memory, volatile random access memory), can also be non-volatile memory (non-volatile memory), such as at least one disk storage.
  • the memory 504 may also be at least one storage device located away from the aforementioned processor 501 .
  • the processor 501 can be combined with the apparatus described in FIG. 4 , the memory 504 stores an application program, and the processor 501 invokes the program code stored in the memory 504 to execute any of the above method steps.
  • the communication bus 502 may be a peripheral component interconnection standard (peripheral component interconnect (PCI for short) bus or extended industry standard architecture (EISA for short) bus, etc.
  • PCI peripheral component interconnect
  • EISA extended industry standard architecture
  • the communication bus 502 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 5 , but it does not mean that there is only one bus or one type of bus.
  • the memory 504 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); the storage 504 may also include a combination of the above types of storage.
  • a volatile memory such as a random access memory (English: random-access memory, abbreviation: RAM)
  • the memory may also include a non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); the storage 504 may also include a combination of the above types of storage.
  • the processor 501 may be a central processing unit (English: central processing unit, abbreviation: CPU), network processor (English: network processor, abbreviation: NP) or a combination of CPU and NP.
  • CPU central processing unit
  • NP network processor
  • the processor 501 may further include a hardware chip.
  • the above-mentioned hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof.
  • the above-mentioned PLD can be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), field programmable logic gate array (English: field-programmable gate array, abbreviation: FPGA), general array logic (English: generic array logic, abbreviation: GAL) or any combination thereof.
  • the memory 504 is also used to store program instructions.
  • the processor 501 may invoke program instructions to implement the memory sharing method shown in the embodiments of FIG. 1 to FIG. 3 of the present application.
  • the embodiment of the present invention also provides a non-transitory computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the processing method of the memory sharing method in any of the above method embodiments.
  • the storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), random storage memory (Random Access Memory, RAM), flash memory (Flash Memory), hard disk (Hard Disk Drive, abbreviation: HDD) or solid-state hard disk (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present invention relates to the technical field of data sharing. Disclosed are a memory sharing method and apparatus, an electronic device, and a readable storage medium. The method comprises: acquiring target data corresponding to a server; storing the target data into a memory space; and when it is detected that the target data needs to be called, extracting the target data from the memory space. By implementing the present invention, memory sharing is achieved by means of a local operation, and there is no need to make a request for the server, such that the target data can be present independent of the server, thereby improving the calling speed and the display speed of the target data, and accelerating the local data processing procedure.

Description

一种内存共享方法、装置、电子设备及可读存储介质A memory sharing method, device, electronic equipment and readable storage medium 技术领域technical field

本发明涉及数据共享技术技术领域,具体涉及一种内存共享方法、装置、电子设备及可读存储介质。The present invention relates to the technical field of data sharing technology, in particular to a memory sharing method, device, electronic equipment and readable storage medium.

背景技术Background technique

随着通信网络的发展,通过服务器在线下载资料越来越普遍,例如下载软件时需要访问服务器以请求该软件对应的数据。然而当网络故障或是网络信号较差时,此时则难以从服务器访问到数据。面对这一问题,目前通常使用递归算法以实现数据访问,但是该方法无法脱离服务器,仍然需要通过服务器进行数据访问,难以通过在本地操作实现内存的共享。With the development of communication networks, it is more and more common to download data online through servers. For example, when downloading software, it is necessary to access the server to request data corresponding to the software. However, when the network fails or the network signal is poor, it is difficult to access data from the server at this time. Faced with this problem, recursive algorithms are usually used to achieve data access at present, but this method cannot be separated from the server, and data access still needs to be performed through the server, and it is difficult to achieve memory sharing through local operations.

技术问题technical problem

有鉴于此,本发明实施例提供了一种内存共享方法、装置、电子设备及可读存储介质,以解决难以通过在本地操作实现内存共享的问题。In view of this, the embodiments of the present invention provide a memory sharing method, device, electronic equipment, and readable storage medium, so as to solve the problem that it is difficult to implement memory sharing through local operations.

技术解决方案technical solution

根据第一方面,本发明实施例提供了一种内存共享方法,包括:获取服务器对应的目标数据;将所述目标数据存储至内存空间;当检测到需要调用所述目标数据时,则从所述内存空间提取所述目标数据。According to the first aspect, an embodiment of the present invention provides a memory sharing method, including: acquiring target data corresponding to the server; storing the target data in memory space; when it is detected that the target data needs to be called, from the Extracting the target data from the memory space.

本发明实施例提供的内存共享方法,通过获取服务器对应的目标数据,将目标数据存储至内存空间,当检测到本地需要调用目标数据时,则从内存空间提取目标数据。该方法通过将目标数据存储在内存空间,无需向服务器请求,提升目标数据的调用速度以及显示速度,通过在本地操作实现了内存的共享。通过将服务器对应的目标数据存储至内存空间,使得目标数据能够脱离服务器而存在,加速本地数据处理进程。The memory sharing method provided by the embodiment of the present invention stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it is detected that the target data needs to be called locally. The method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation. By storing the target data corresponding to the server in the memory space, the target data can exist without the server, speeding up the local data processing process.

结合第一方面,在第一方面的第一实施方式中,所述将所述目标数据存储至内存空间,包括:对所述目标数据进行分块处理,得到多个目标数据块;将所述多个目标数据块平行存储至所述内存空间。With reference to the first aspect, in the first implementation manner of the first aspect, the storing the target data in the memory space includes: performing block processing on the target data to obtain multiple target data blocks; Multiple target data blocks are stored in the memory space in parallel.

本发明实施例提供的内存共享方法,通过对目标数据进行分块处理,得到多个目标数据块,将多个目标数据块平行存储至内存空间据,以便服务器离线时,能够从内存空间中提取剩余的目标数据块,保证本地数据处理进程。In the memory sharing method provided by the embodiment of the present invention, multiple target data blocks are obtained by dividing the target data into blocks, and the multiple target data blocks are stored in parallel in the memory space, so that when the server is offline, it can be extracted from the memory space. The remaining target data blocks are guaranteed to be processed locally.

结合第一方面第一实施方式,在第一方面的第二实施方式中,所述将所述多个目标数据块平行存储至所述内存空间,包括:获取所述目标数据的占用空间;判断所述占用空间是否超过预设值;当所述占用空间超过所述预设值时,获取存储至所述内存空间的目标数据块的目标数量;将所述目标数量的所述目标数据块平行存储至所述内存空间。With reference to the first implementation manner of the first aspect, in the second implementation manner of the first aspect, the parallel storing of the multiple target data blocks in the memory space includes: acquiring the occupied space of the target data; judging Whether the occupied space exceeds the preset value; when the occupied space exceeds the preset value, obtain the target number of target data blocks stored in the memory space; parallelize the target number of target data blocks stored in the memory space.

结合第一方面第二实施方式,在第一方面的第三实施方式中,所述内存共享方法还包括:将剩余的所述目标数据块保存至本地文件,判断是否需要调用所述本地文件中的目标数据块;当需要调用所述本地文件中的目标数据块时,将所述目标数据块提取至所述内存空间。With reference to the second implementation manner of the first aspect, in the third implementation manner of the first aspect, the memory sharing method further includes: saving the remaining target data blocks to a local file, and judging whether it is necessary to call the the target data block; when the target data block in the local file needs to be called, the target data block is extracted to the memory space.

本发明实施例提供的内存共享方法,通过获取目标数据的占用空间,判断目标数据的占用空间超过预设值时,获取存储至内存空间的目标数据块的目标数量,将目标数量的目标数据块平行存储至内存空间,并将剩余的目标数据块保存至本地文件,由此避免目标数据占用过大的内存,且通过平行存储能够避免多次数据解析,提高了数据提取速度,进而保证了本地数据的处理速度。通过将一部分目标数据块保存至内存,将另一部分目标数据块保存至本地文件,当需要本地文件中的目标数据块时再将其提取至内存,在保证本地数据处理速度的同时保证了本地数据处理进程接续性。The memory sharing method provided by the embodiment of the present invention obtains the target number of target data blocks stored in the memory space by obtaining the occupied space of the target data and judging that the occupied space of the target data exceeds a preset value, and stores the target number of target data blocks Parallel storage to the memory space, and save the remaining target data blocks to local files, thereby avoiding excessive memory usage by the target data, and through parallel storage, multiple data analysis can be avoided, the speed of data extraction is improved, and the local Data processing speed. By saving a part of the target data block to the internal memory and another part of the target data block to the local file, when the target data block in the local file is needed, it is extracted to the memory, while ensuring the local data processing speed, the local data is guaranteed Handles process continuity.

结合第一方面,在第一方面的第四实施方式中,所述从所述内存空间提取所述目标数据,包括:响应于数据访问请求,确定所述数据访问请求对应的目标数据;从所述内存空间中提取所述目标数据。With reference to the first aspect, in the fourth implementation manner of the first aspect, the extracting the target data from the memory space includes: in response to a data access request, determining the target data corresponding to the data access request; Extract the target data from the memory space.

本发明实施例提供的内存共享方法,通过响应于数据访问请求,确定数据访问请求对应的目标数据,从内存空间中提取目标数据。该方法能够基于数据访问请求提供相应的目标数据,提高了数据提取的准确性,避免了无效数据的提取。In the memory sharing method provided by the embodiment of the present invention, by responding to the data access request, determining the target data corresponding to the data access request, and extracting the target data from the memory space. The method can provide corresponding target data based on the data access request, improves the accuracy of data extraction, and avoids the extraction of invalid data.

结合第一方面第四实施方式,在第一方面的第五实施方式中,所述从所述内存空间中提取所述目标数据,包括:获取数据提取的起始点和结束点;基于所述起始点和所述结束点,从所述内存空间中提取所述起始点和所述结束点之间的数据,得到所述目标数据。With reference to the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, the extracting the target data from the memory space includes: obtaining a start point and an end point of data extraction; start point and the end point, and extract data between the start point and the end point from the memory space to obtain the target data.

本发明实施例提供的内存共享方法,通过获取数据提取的起始点和结束点,并基于起始点和结束点从内存空间中提取位于起始点和结束点之间的数据,得到目标数据,在保证目标数据精准提取的同时保证了目标数据的提取灵活性。The memory sharing method provided by the embodiment of the present invention acquires the starting point and the ending point of data extraction, and extracts the data located between the starting point and the ending point from the memory space based on the starting point and the ending point, and obtains the target data. Accurate extraction of target data ensures the flexibility of target data extraction.

结合第一方面,在第一方面的第六实施方式中,所述获取服务器对应的目标数据,包括:向所述服务器发送数据请求信息;接收所述服务器下发的对应于所述数据请求信息的目标数据。With reference to the first aspect, in the sixth implementation manner of the first aspect, the acquiring the target data corresponding to the server includes: sending data request information to the server; receiving the data corresponding to the data request information sent by the server target data.

本发明实施例提供的内存共享方法,通过向服务器发送数据请求信息,并接收服务器下发的对应于数据请求信息的目标数据,以将目标数据全部保存至内存空间,便于本地在脱离服务器时仍然能够完成数据处理进程。The memory sharing method provided by the embodiment of the present invention sends data request information to the server and receives the target data corresponding to the data request information sent by the server, so as to save all the target data in the memory space, so that it is convenient for the local Able to complete the data processing process.

根据第二方面,本发明提供了一种内存共享装置,包括:获取模块,用于获取服务器对应的目标数据;存储模块,用于将所述目标数据存储至内存空间;提取模块,用于当检测到需要调用所述目标数据时,则从所述内存空间提取所述目标数据。According to the second aspect, the present invention provides a memory sharing device, comprising: an acquisition module, configured to acquire target data corresponding to a server; a storage module, configured to store the target data in a memory space; an extraction module, configured to When it is detected that the target data needs to be called, the target data is extracted from the memory space.

本发明实施例提供的内存共享装置,通过获取服务器对应的目标数据,将目标数据存储至内存空间,当检测到本地需要调用目标数据时,则从内存空间提取目标数据。该方法通过将目标数据存储在内存空间,无需向服务器请求,提升目标数据的调用速度以及显示速度,通过在本地操作实现了内存的共享。通过将服务器对应的目标数据存储至内存空间,使得目标数据能够脱离服务器而存在,加速本地数据处理进程。The memory sharing device provided by the embodiment of the present invention stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it detects that the target data needs to be called locally. The method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation. By storing the target data corresponding to the server in the memory space, the target data can exist without the server, speeding up the local data processing process.

根据第三方面,本发明提供了一种电子设备,包括:存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行第一方面或第一方面任一实施方式所述的内存共享方法。According to a third aspect, the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor are connected to each other in communication, the memory stores computer instructions, and the processor executes the The computer has instructions to execute the memory sharing method described in the first aspect or any implementation manner of the first aspect.

根据第四方面,本发明提供了一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使计算机执行第一方面或第一方面任一实施方式所述的内存共享方法。According to a fourth aspect, the present invention provides a computer-readable storage medium, which is characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to make a computer perform the first aspect or any one of the first aspects. A memory sharing method described in an implementation manner.

有益效果Beneficial effect

通过实施本发明,在本地操作实现了内存的共享,无需向服务器请求,使得目标数据能够脱离服务器而存在,提升目标数据的调用速度以及显示速度,加速本地数据处理进程。Through the implementation of the present invention, memory sharing is realized in local operation without requesting to the server, so that target data can exist without the server, the calling speed and display speed of target data are improved, and the local data processing process is accelerated.

附图说明Description of drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific implementation of the present invention or the technical solutions in the prior art, the following will briefly introduce the accompanying drawings that need to be used in the specific implementation or description of the prior art. Obviously, the accompanying drawings in the following description The drawings show some implementations of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative work.

图1是根据本发明实施例的内存共享方法的流程图;Fig. 1 is a flowchart of a memory sharing method according to an embodiment of the present invention;

图2是根据本发明实施例的内存共享方法的另一流程图;FIG. 2 is another flowchart of a memory sharing method according to an embodiment of the present invention;

图3是根据本发明实施例的内存共享方法的另一流程图;FIG. 3 is another flowchart of a memory sharing method according to an embodiment of the present invention;

图4是根据本发明实施例的内存共享装置的结构框图;FIG. 4 is a structural block diagram of a memory sharing device according to an embodiment of the present invention;

图5是本发明实施例提供的电子设备的硬件结构示意图。FIG. 5 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention.

本发明的最佳实施方式BEST MODE FOR CARRYING OUT THE INVENTION

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts belong to the protection scope of the present invention.

根据本发明实施例,提供了一种内存共享方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, an embodiment of a memory sharing method is provided. It should be noted that the steps shown in the flowcharts of the drawings can be executed in a computer system such as a set of computer-executable instructions, and, although A logical order is shown in the flowcharts, but in some cases the steps shown or described may be performed in an order different from that shown or described herein.

在本实施例中提供了一种内存共享方法,可用于电子设备,如手机、平板电脑、电脑等,图1是根据本发明实施例的内存共享方法的流程图,如图1所示,该流程包括如下步骤:In this embodiment, a memory sharing method is provided, which can be used in electronic devices, such as mobile phones, tablet computers, computers, etc. FIG. 1 is a flow chart of a memory sharing method according to an embodiment of the present invention. As shown in FIG. 1 , the The process includes the following steps:

S11,获取服务器对应的目标数据。S11. Obtain target data corresponding to the server.

目标数据为电子设备本地向服务器请求得到的运行数据,电子设备可以提前从服务器中获取运行数据。例如,当电子设备需要安装一款软件时,此时电子设备能够在软件安装前期从服务器中获取软件数据。The target data is the running data that the electronic device locally requests from the server, and the electronic device can obtain the running data from the server in advance. For example, when the electronic device needs to install a piece of software, the electronic device can obtain software data from the server in the early stage of software installation.

S12,将目标数据存储至内存空间。S12, storing the target data in the memory space.

内存空间为电子设备的本地内存空间。电子设备将其从服务器中获取的目标数据保存至内存空间中,在本地进行数据处理时,每次执行页面跳转即可直接从内存空间中提取所需数据,无需向服务器请求。具体地,电子设备可以对其获取的目标数据进行数据块划分,并将划分得到的目标数据块依次存储至内存空间。The memory space is a local memory space of the electronic device. The electronic device saves the target data it obtains from the server in the memory space. When performing data processing locally, the required data can be directly extracted from the memory space every time a page jump is performed without requesting the server. Specifically, the electronic device may divide the acquired target data into data blocks, and sequentially store the divided target data blocks into the memory space.

S13,当检测到需要调用目标数据时,则从内存空间提取目标数据。S13. When it is detected that the target data needs to be called, the target data is extracted from the memory space.

电子设备在数据处理过程中,若检测到其需要从服务器获取目标数据时,此时若电子设备所处环境网络环境较好,则直接从服务器中下载目标数据进行使用,若电子设备所处环境网络环境较差,此时电子设备可以从内存空间中提起其所需的目标数据进行调用,以保证数据处理进程不被中断。例如,电子设备下载软件时需要访问服务器以获取软件数据,若网络中断或者网络信号差,则难以跳转页面进行软件下载,而将服务器上对应的软件数据保存至内存空间,即使网络中断或者网络信号差,电子设备仍然能够从内存空间中提取所需软件数据进行软件安装。During the data processing process of the electronic device, if it detects that it needs to obtain target data from the server, if the environment where the electronic device is located has a good network environment, it will directly download the target data from the server for use. The network environment is poor, and at this time, the electronic device can retrieve the required target data from the memory space for calling, so as to ensure that the data processing process is not interrupted. For example, when an electronic device downloads software, it needs to access the server to obtain software data. If the network is interrupted or the network signal is poor, it is difficult to jump to the page to download the software, and the corresponding software data on the server is saved to the memory space. Even if the signal is poor, the electronic device can still extract the required software data from the memory space for software installation.

同时,由于是内存共享,能够防止内存中的内容被恶意篡改,用户可以通过对内存中的内容进行加密,或者保存双份,其中一份作为源,另外一份共享内容定时与源做匹配以达到内容一致。At the same time, because it is memory sharing, it can prevent the content in the memory from being maliciously tampered with. Users can encrypt the content in the memory, or save two copies, one of which is used as the source, and the other shared content is regularly matched with the source. achieve content consistency.

本实施例提供的内存共享方法,通过获取服务器对应的目标数据,将目标数据存储至内存空间,当检测到本地需要调用目标数据时,则从内存空间提取目标数据。该方法通过将目标数据存储在内存空间,无需向服务器请求,提升目标数据的调用速度以及显示速度,通过在本地操作实现了内存的共享。通过将服务器对应的目标数据存储至内存空间,使得目标数据能够脱离服务器而存在,加速本地数据处理进程。The memory sharing method provided in this embodiment stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it is detected that the target data needs to be called locally. The method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation. By storing the target data corresponding to the server in the memory space, the target data can exist without the server, speeding up the local data processing process.

在本实施例中提供了一种内存共享方法,可用于电子设备,如手机、平板电脑、电脑等,图2是根据本发明实施例的内存共享方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a memory sharing method is provided, which can be used in electronic devices, such as mobile phones, tablet computers, computers, etc. FIG. 2 is a flow chart of a memory sharing method according to an embodiment of the present invention. As shown in FIG. 2, the The process includes the following steps:

S21,获取服务器对应的目标数据。详细说明参见上述实施例对应步骤S11的相关描述,此处不再赘述。S21. Obtain target data corresponding to the server. For detailed description, refer to the relevant description of the corresponding step S11 in the above embodiment, which will not be repeated here.

S22,将目标数据存储至内存空间。S22. Store the target data in the memory space.

具体地,上述步骤S22可以包括如下步骤:Specifically, the above step S22 may include the following steps:

S221,对目标数据进行分块处理,得到多个目标数据块。S221. Perform block processing on the target data to obtain multiple target data blocks.

目标数据块为划分目标数据得到的数据块,例如,将1G的目标数据划分为10个目标数据块,且划分得到的10个目标数据块上均存在分块标识符,以便电子设备可以根据其运行过程调用所需要的目标数据块,其中,目标数据的划分可以是均等划分,也可以不均等划分,本申请对此不作具体限定,本领域技术人员可以根据实际需要确定。The target data block is the data block obtained by dividing the target data. For example, the 1G target data is divided into 10 target data blocks, and there are block identifiers on the 10 target data blocks obtained by dividing, so that the electronic device can The target data block required by the running process call, wherein the division of the target data may be equal or unequal. This application does not specifically limit this, and those skilled in the art can determine it according to actual needs.

S222,将多个目标数据块平行存储至内存空间。S222. Store multiple target data blocks in parallel in memory space.

平行存储为各个目标数据块之间不存在嵌套关系,每个目标数据块均可以单独提取进行调用。电子设备在得到多个目标数据块后,按照目标数据块中设置的分块标识符依次存储至内存空间中,由此在电子设备调用某一目标数据块时无需进行嵌套解析,提高了目标数据块的提取速度。Parallel storage means that there is no nesting relationship between each target data block, and each target data block can be extracted and called separately. After the electronic device obtains multiple target data blocks, it stores them in the memory space sequentially according to the block identifiers set in the target data blocks, so that when the electronic device calls a certain target data block, it does not need to perform nested parsing, which improves the target Data block fetch speed.

具体地,上述步骤S222可以包括:Specifically, the above step S222 may include:

(1)获取目标数据的占用空间。(1) Obtain the occupied space of the target data.

占用空间为存储目标数据所需空间容量。电子设备在获取目标数据时,可以解析目标数据的属性以确定其所需空间容量,以便为其分配合适的本地存储空间。例如,目标数据为300M,电子设备则可以为该目标数据分配300M的本地存储空间。The occupied space is the space capacity required to store the target data. When the electronic device acquires the target data, it can analyze the attributes of the target data to determine its required space capacity, so as to allocate a suitable local storage space for it. For example, if the target data is 300M, the electronic device may allocate 300M of local storage space for the target data.

(2)判断占用空间是否超过预设值。(2) Determine whether the occupied space exceeds the preset value.

预设值为内存所支持目标数据的最大存储空间。电子设备可以比较目标数据的占用空间与预设值之间的关系,确定目标数据的占用空间是否超过预设值。当目标数据的占用空间超过预设值时,执行步骤(3),否则跳到步骤(5)执行。The preset value is the maximum storage space of the target data supported by the internal memory. The electronic device can compare the relationship between the occupied space of the target data and the preset value, and determine whether the occupied space of the target data exceeds the preset value. When the occupied space of the target data exceeds the preset value, execute step (3), otherwise skip to step (5) for execution.

(3)获取存储至内存空间的目标数据块的目标数量。(3) Obtain the target number of target data blocks stored in the memory space.

当目标数据的占用空间超过预设值时,表示内存没有足够存储空间存储该目标数据,此时电子设备可以将部分目标数据块存储至内存空间,其余的保存至本地文件。其中,存储至内存空间的目标数据块的目标数量可以根据内存空间确定,例如,当前存在10个平均划分得到的目标数据块(1~10),而内存空间只能存储3个目标数据块,此时电子设备可以从10个目标数据块中提取1~3的目标数据块存储至本地空间,当然也可以是其他顺序的目标数据块,此处对此不作具体限定。When the space occupied by the target data exceeds the preset value, it means that the internal memory does not have enough storage space to store the target data. At this time, the electronic device can store part of the target data blocks in the memory space, and save the rest in local files. Among them, the target number of target data blocks stored in the memory space can be determined according to the memory space. For example, there are currently 10 target data blocks (1~10) obtained by evenly dividing, and the memory space can only store 3 target data blocks. At this time, the electronic device may extract 1 to 3 target data blocks from the 10 target data blocks and store them in the local space. Of course, other sequences of target data blocks may also be used, which is not specifically limited here.

(4)将目标数量的目标数据块平行存储至内存空间。(4) Parallel store the target number of target data blocks into the memory space.

在确定需要存储至内存空间中的目标数据块后,电子设备可以将目标数量的目标数据块平行存储至内存空间。例如,当前存在10个平均划分得到的目标数据块(1~10),电子设备可以将1~3的目标数据块依次存储至内存空间。After determining the target data blocks that need to be stored in the memory space, the electronic device may store a target number of target data blocks in parallel in the memory space. For example, currently there are 10 target data blocks (1-10) that are equally divided, and the electronic device may sequentially store the target data blocks 1-3 in the memory space.

(5)将剩余的目标数据块保存至本地文件。(5) Save the remaining target data blocks to a local file.

电子设备将其余的目标数据块保存至本地文件,生成文件表。以10个平均划分的目标数据块1~10为例,电子设备在将1~3的目标数据块依次存储至内存空间后,可以将4~10的目标数据块保存到本地文件中,并基于4~10的目标数据块生成文件表,以便提取对应分块标识符的目标数据块。The electronic device saves the remaining target data blocks to a local file to generate a file table. Taking 10 evenly divided target data blocks 1~10 as an example, after the electronic device sequentially stores target data blocks 1~3 into the memory space, it can save target data blocks 4~10 in a local file, and based on 4 to 10 target data blocks generate a file table, so as to extract the target data block corresponding to the block identifier.

(6)判断是否需要调用本地文件中的目标数据块。(6) Determine whether to call the target data block in the local file.

电子设备在运行过程中可以实时检测其是否需要调用本地文件中的目标数据块。当检测到电子设备需要调用本地文件中的目标数据块时,执行步骤(7),否则继续当前的数据处理进程。During operation, the electronic device can detect in real time whether it needs to call the target data block in the local file. When it is detected that the electronic device needs to call the target data block in the local file, step (7) is performed; otherwise, the current data processing process is continued.

(7)将目标数据块提取至内存空间。(7) Extract the target data block to the memory space.

当需要调用本地文件中的目标数据块时,此时电子设备可以从本地文件中提取对应的目标数据块,将其提取至内存空间,此时所有电子设备运行所需数据均已存储至内存空间,电子设备可以根据其数据处理进程随时调用目标数据块。例如,电子设备在提取目标数据块1~3并执行完成后,则继续执行需要后续目标数据块,此时电子设备可以从文件表中将其他所需目标数据块提取到内存空间中,以使当前数据处理进程所需目标数据都存储在内存空间中。When the target data block in the local file needs to be called, the electronic device can extract the corresponding target data block from the local file and extract it to the memory space. At this time, all the data required for the operation of the electronic device has been stored in the memory space , the electronic device can call the target data block at any time according to its data processing process. For example, after the electronic device extracts the target data blocks 1~3 and completes the execution, the subsequent target data blocks are required for further execution, and at this time, the electronic device can extract other required target data blocks from the file table into the memory space, so that The target data required by the current data processing process are all stored in the memory space.

S23,当检测到需要调用目标数据时,则从内存空间提取目标数据。详细说明参见上述实施例对应步骤S13的相关描述,此处不再赘述。S23. When it is detected that the target data needs to be called, the target data is extracted from the memory space. For detailed description, refer to the relevant description of the corresponding step S13 in the above embodiment, and details are not repeated here.

本实施例提供的内存共享方法,通过对目标数据进行分块处理,得到多个目标数据块,将多个目标数据块平行存储至内存空间据,以便服务器离线时,能够从内存空间中提取剩余的目标数据块,保证本地数据处理进程。通过获取目标数据的占用空间,判断目标数据的占用空间超过预设值时,获取存储至内存空间的目标数据块的目标数量,将目标数量的目标数据块平行存储至内存空间,并将剩余的目标数据块保存至本地文件,由此避免目标数据占用过大的内存,且通过平行存储能够避免多次数据解析,提高了数据提取速度,进而保证了本地数据的处理速度。通过将一部分目标数据块保存至内存,将另一部分目标数据块保存至本地文件,当需要本地文件中的目标数据块时再将其提取至内存,在保证本地数据处理速度的同时保证了本地数据处理进程接续性。The memory sharing method provided in this embodiment obtains multiple target data blocks by dividing the target data into blocks, and stores the multiple target data blocks in parallel in the memory space, so that when the server is offline, the remaining data can be extracted from the memory space. The target data block to ensure the local data processing process. By obtaining the occupied space of the target data and judging that the occupied space of the target data exceeds the preset value, obtain the target number of target data blocks stored in the memory space, store the target number of target data blocks in parallel in the memory space, and store the remaining The target data block is saved to a local file, thereby preventing the target data from occupying too much memory, and through parallel storage, multiple data analysis can be avoided, the speed of data extraction is improved, and the processing speed of local data is guaranteed. By saving a part of the target data block to the internal memory and another part of the target data block to the local file, when the target data block in the local file is needed, it is extracted to the memory, while ensuring the local data processing speed, the local data is guaranteed Handles process continuity.

在本实施例中提供了一种内存共享方法,可用于电子设备,如手机、平板电脑、电脑等,图3是根据本发明实施例的内存共享方法的流程图,如图3所示,该流程包括如下步骤:In this embodiment, a memory sharing method is provided, which can be used in electronic devices, such as mobile phones, tablet computers, computers, etc. FIG. 3 is a flow chart of the memory sharing method according to an embodiment of the present invention. As shown in FIG. 3 , the The process includes the following steps:

S31,获取服务器对应的目标数据。S31. Obtain target data corresponding to the server.

具体地,上述步骤S31可以包括:Specifically, the above step S31 may include:

S311,向服务器发送数据请求信息。S311. Send data request information to the server.

数据请求信息用于电子设备从服务器请求相应的目标数据。电子设备可以向服务器发送数据请求信息,并将服务器中的数据存储在内存空间,以便在电子设备需要时能够直接从内存空间提取,无需向服务器发送请求,由此不受网络环境的限制,通过将服务器数据保存至内存空间,实现电子设备脱离服务器后仍然能够直接调用内存空间中的数据完成数据处理。The data request information is used for the electronic device to request corresponding target data from the server. The electronic device can send data request information to the server, and store the data in the server in the memory space, so that it can be directly extracted from the memory space when the electronic device needs it, without sending a request to the server, so it is not limited by the network environment, through Save the server data to the memory space, so that the electronic device can still directly call the data in the memory space to complete the data processing after it is separated from the server.

S312,接收服务器下发的对应于数据请求信息的目标数据。S312. Receive target data corresponding to the data request information delivered by the server.

服务器在接收到电子设备发送的数据请求信息后,可以将对应于该数据请求信息的目标数据发送至电子设备。相应地,电子设备可以接收服务器下发的目标数据。After receiving the data request information sent by the electronic device, the server may send target data corresponding to the data request information to the electronic device. Correspondingly, the electronic device can receive the target data delivered by the server.

S32,将目标数据存储至内存空间。详细说明参见上述实施例对应步骤S22的相关描述,此处不再赘述。S32. Store the target data in the memory space. For detailed description, refer to the relevant description of the corresponding step S22 in the above embodiment, and details are not repeated here.

S33,当检测到需要调用目标数据时,则从内存空间提取目标数据。S33. When it is detected that the target data needs to be called, the target data is extracted from the memory space.

具体地,上述步骤S33可以包括:Specifically, the above step S33 may include:

S331,响应于数据访问请求,确定数据访问请求对应的目标数据。S331. In response to the data access request, determine target data corresponding to the data access request.

电子设备的存储器可以响应于电子设备对其存储数据的数据访问请求,基于数据访问请求从内存空间中搜索对应的目标数据,并将目标数据在内存空间中的存储地址反馈至电子设备的处理器。The memory of the electronic device can respond to the data access request of the electronic device for its stored data, search the corresponding target data from the memory space based on the data access request, and feed back the storage address of the target data in the memory space to the processor of the electronic device .

S332,从内存空间中提取目标数据。S332. Extract target data from memory space.

电子设备的处理器在接收到存储器反馈的存储地址后,可以根据该存储地址从内存空间提取其数据处理所需的目标数据。After receiving the storage address fed back by the memory, the processor of the electronic device may extract target data required for data processing from the memory space according to the storage address.

具体地,上述步骤S332可以包括:Specifically, the above step S332 may include:

(1)获取数据提取的起始点和结束点。(1) Get the start point and end point of data extraction.

起始点为数据提取的起始位置,即待提取数据在内存空间中的起始存储地址;结束点为数据提取的终止位置,即待提取数据在内存空间中的终止存储地址。可选地,电子设备可以是采用指针的移动确定数据提取的起始点,再确定其所需提取数据的长度,确定出数据提起的结束点。具体地,电子设备的处理器每次从内存空间提取数据时,可以获取其所需数据在内存空间的起始存储地址和终止存储地址。The starting point is the starting position of data extraction, that is, the starting storage address of the data to be extracted in the memory space; the ending point is the ending position of data extraction, that is, the ending storage address of the data to be extracted in the memory space. Optionally, the electronic device may use the movement of the pointer to determine the start point of data extraction, and then determine the length of the data to be extracted to determine the end point of data extraction. Specifically, each time the processor of the electronic device extracts data from the memory space, it can obtain the start storage address and the end storage address of the required data in the memory space.

(2)基于起始点和结束点,从内存空间中提取起始点和结束点之间的数据,得到目标数据。(2) Based on the start point and the end point, extract the data between the start point and the end point from the memory space to obtain the target data.

电子设备的处理器在获取到存储地址后,访问内存空间,并根据其获取的数据提取的起始点和结束点,从内存空间中提取出起始点至结束点之间的数据,起始点至结束点之间的数据即为目标数据。After the processor of the electronic device obtains the storage address, it accesses the memory space, and extracts the data between the start point and the end point from the memory space according to the starting point and end point of the data extraction obtained by it, and the data between the starting point and the end point The data between the points is the target data.

本实施例提供的内存共享方法,通过向服务器发送数据请求信息,并接收服务器下发的对应于数据请求信息的目标数据,以将目标数据全部保存至内存空间,便于本地在脱离服务器时仍然能够完成数据处理进程。通过响应于数据访问请求,确定数据访问请求对应的目标数据,从内存空间中提取目标数据。该方法能够基于数据访问请求提供相应的目标数据,提高了数据提取的准确性,避免了无效数据的提取。通过获取数据提取的起始点和结束点,并基于起始点和结束点从内存空间中提取位于起始点和结束点之间的数据,得到目标数据,在保证目标数据精准提取的同时保证了目标数据的提取灵活性。The memory sharing method provided by this embodiment sends data request information to the server and receives the target data corresponding to the data request information sent by the server to save all the target data in the memory space, so that the local can still Complete the data processing process. By responding to the data access request, determining the target data corresponding to the data access request, and extracting the target data from the memory space. The method can provide corresponding target data based on the data access request, improves the accuracy of data extraction, and avoids the extraction of invalid data. By obtaining the start point and end point of data extraction, and extracting the data located between the start point and end point from the memory space based on the start point and end point, the target data is obtained, and the target data is guaranteed while ensuring the accurate extraction of target data extraction flexibility.

在本实施例中还提供了一种内存共享装置,该装置用于实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a memory sharing device is also provided, which is used to implement the above embodiments and preferred implementation modes, and what has already been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.

本实施例提供一种内存共享装置,如图4所示,包括:This embodiment provides a memory sharing device, as shown in Figure 4, including:

获取模块41,用于获取服务器对应的目标数据。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。An acquisition module 41, configured to acquire target data corresponding to the server. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

存储模块42,用于将目标数据存储至内存空间。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The storage module 42 is used for storing the target data in the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

提取模块43,用于当检测到需要调用目标数据时,则从内存空间提取目标数据。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The extraction module 43 is configured to extract the target data from the memory space when it is detected that the target data needs to be invoked. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

本实施例提供的内存共享装置,通过获取服务器对应的目标数据,将目标数据存储至内存空间,当检测到本地需要调用目标数据时,则从内存空间提取目标数据。该方法通过将目标数据存储在内存空间,无需向服务器请求,提升目标数据的调用速度以及显示速度,通过在本地操作实现了内存的共享。通过将服务器对应的目标数据存储至内存空间,使得目标数据能够脱离服务器而存在,加速本地数据处理进程。The memory sharing device provided in this embodiment stores the target data in the memory space by acquiring the target data corresponding to the server, and extracts the target data from the memory space when it detects that the target data needs to be called locally. The method stores the target data in the memory space without requesting the server, improves the call speed and the display speed of the target data, and realizes memory sharing through local operation. By storing the target data corresponding to the server in the memory space, the target data can exist without the server, speeding up the local data processing process.

作为本申请一个可选的实施方式,上述存储模块42可以包括:As an optional implementation manner of the present application, the above-mentioned storage module 42 may include:

分块子模块,用于对目标数据进行分块处理,得到多个目标数据块。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The block sub-module is used to process the target data into blocks to obtain multiple target data blocks. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

存储子模块,用于将多个目标数据块平行存储至内存空间。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The storage sub-module is used to store multiple target data blocks in parallel to the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

具体地,上述存储子模块可以包括:Specifically, the above-mentioned storage submodule may include:

第一获取子模块,用于获取目标数据的占用空间。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The first acquiring submodule is used to acquire the occupied space of the target data. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

第一判断子模块,用于判断占用空间是否超过预设值。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The first judging sub-module is used to judge whether the occupied space exceeds a preset value. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

第二获取子模块,用于当占用空间超过预设值时,获取存储至内存空间的目标数据块的目标数量。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The second obtaining sub-module is used to obtain the target number of target data blocks stored in the memory space when the occupied space exceeds a preset value. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

平行存储子模块,用于将目标数量的目标数据块平行存储至内存空间。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The parallel storage sub-module is used for parallel storage of the target number of target data blocks into the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

保存子模块,用于将剩余的目标数据块保存至本地文件。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The save submodule is used to save the remaining target data blocks to local files. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

第二判断子模块,用于判断是否需要调用本地文件中的目标数据块。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The second judging submodule is used to judge whether the target data block in the local file needs to be called. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

提取子模块,用于当需要调用本地文件中的目标数据块时,将目标数据块提取至内存空间。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The extraction submodule is used to extract the target data block to the memory space when the target data block in the local file needs to be called. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

作为本申请一个可选的实施方式,上述提取模块43可以包括:As an optional implementation manner of the present application, the above-mentioned extraction module 43 may include:

第一响应子模块,用于响应于数据访问请求,确定数据访问请求对应的目标数据。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The first response submodule is configured to determine target data corresponding to the data access request in response to the data access request. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

提取子模块,用于从内存空间中提取目标数据。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The extraction submodule is used to extract target data from the memory space. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

具体地,上述提取子模块可以包括:Specifically, the above-mentioned extraction submodule may include:

第三获取子模块,用于获取数据提取的起始点和结束点。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The third obtaining sub-module is used to obtain the starting point and the ending point of data extraction. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

确定子模块,用于基于起始点和结束点,从内存空间中提取起始点和结束点之间的数据,得到目标数据。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The determining submodule is used to extract data between the starting point and the ending point from the memory space based on the starting point and the ending point to obtain target data. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

作为本申请一个可选的实施方式,上述获取模块41可以包括:As an optional implementation manner of the present application, the acquisition module 41 may include:

发送子模块,用于向服务器发送数据请求信息。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The sending sub-module is used to send data request information to the server. For details, refer to the related descriptions corresponding to the above method embodiments, and details are not repeated here.

接收子模块,用于接收服务器下发的对应于数据请求信息的目标数据。详细说明参见上述方法实施例对应的相关描述,此处不再赘述。The receiving sub-module is used to receive the target data corresponding to the data request information issued by the server. For details, refer to the related descriptions corresponding to the above method embodiments, which will not be repeated here.

本实施例中的内存共享装置是以功能单元的形式来呈现,这里的单元是指ASIC电路,执行一个或多个软件或固定程序的处理器和存储器,和/或其他可以提供上述功能的器件。The memory sharing device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and/or other devices that can provide the above functions .

本发明实施例还提供一种电子设备,具有图4所示的内存共享装置。An embodiment of the present invention also provides an electronic device, which has the memory sharing device shown in FIG. 4 .

请参阅图5,图5是本发明可选实施例提供的一种电子设备的结构示意图,如图5所示,该电子设备可以包括:至少一个处理器501,例如CPU(Central Processing Unit,中央处理器),至少一个通信接口503,存储器504,至少一个通信总线502。其中,通信总线502用于实现这些组件之间的连接通信。其中,通信接口503可以包括显示屏(Display)、键盘(Keyboard),可选通信接口503还可以包括标准的有线接口、无线接口。存储器504可以是高速RAM存储器(Random Access Memory,易挥发性随机存取存储器),也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器504可选的还可以是至少一个位于远离前述处理器501的存储装置。其中处理器501可以结合图4所描述的装置,存储器504中存储应用程序,且处理器501调用存储器504中存储的程序代码,以用于执行上述任一方法步骤。Please refer to FIG. 5. FIG. 5 is a schematic structural diagram of an electronic device provided in an optional embodiment of the present invention. As shown in FIG. 5, the electronic device may include: at least one processor 501, such as a CPU (Central Processing Unit, central processing unit), at least one communication interface 503, memory 504, and at least one communication bus 502. Wherein, the communication bus 502 is used to realize connection and communication between these components. Wherein, the communication interface 503 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 503 may also include a standard wired interface and a wireless interface. Memory 504 can be a high-speed RAM memory (Random Access Memory, volatile random access memory), can also be non-volatile memory (non-volatile memory), such as at least one disk storage. Optionally, the memory 504 may also be at least one storage device located away from the aforementioned processor 501 . Wherein the processor 501 can be combined with the apparatus described in FIG. 4 , the memory 504 stores an application program, and the processor 501 invokes the program code stored in the memory 504 to execute any of the above method steps.

其中,通信总线502可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。通信总线502可以分为地址总线、数据总线、控制总线等。为便于表示,图5中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Wherein, the communication bus 502 may be a peripheral component interconnection standard (peripheral component interconnect (PCI for short) bus or extended industry standard architecture (EISA for short) bus, etc. The communication bus 502 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 5 , but it does not mean that there is only one bus or one type of bus.

其中,存储器504可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器也可以包括非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器504还可以包括上述种类存储器的组合。Wherein, the memory 504 may include a volatile memory (English: volatile memory), such as a random access memory (English: random-access memory, abbreviation: RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); the storage 504 may also include a combination of the above types of storage.

其中,处理器501可以是中央处理器(英文:central processing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。Wherein, the processor 501 may be a central processing unit (English: central processing unit, abbreviation: CPU), network processor (English: network processor, abbreviation: NP) or a combination of CPU and NP.

其中,处理器501还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic array logic, 缩写:GAL)或其任意组合。Wherein, the processor 501 may further include a hardware chip. The above-mentioned hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), field programmable logic gate array (English: field-programmable gate array, abbreviation: FPGA), general array logic (English: generic array logic, abbreviation: GAL) or any combination thereof.

可选地,存储器504还用于存储程序指令。处理器501可以调用程序指令,实现如本申请图1至图3实施例中所示的内存共享方法。Optionally, the memory 504 is also used to store program instructions. The processor 501 may invoke program instructions to implement the memory sharing method shown in the embodiments of FIG. 1 to FIG. 3 of the present application.

本发明实施例还提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的内存共享方法的处理方法。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(Flash Memory)、硬盘(Hard Disk Drive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;所述存储介质还可以包括上述种类的存储器的组合。The embodiment of the present invention also provides a non-transitory computer storage medium, the computer storage medium stores computer executable instructions, and the computer executable instructions can execute the processing method of the memory sharing method in any of the above method embodiments. Wherein, the storage medium can be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), random storage memory (Random Access Memory, RAM), flash memory (Flash Memory), hard disk (Hard Disk Drive, abbreviation: HDD) or solid-state hard disk (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.

虽然结合附图描述了本发明的实施例,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention. within the bounds of the requirements.

Claims (10)

一种内存共享方法,其特征在于,包括:A memory sharing method, characterized in that, comprising: 获取服务器对应的目标数据;Obtain the target data corresponding to the server; 将所述目标数据存储至内存空间;storing the target data into memory space; 当检测到需要调用所述目标数据时,则从所述内存空间提取所述目标数据。When it is detected that the target data needs to be called, the target data is extracted from the memory space. 根据权利要求1所述的方法,其特征在于,所述将所述目标数据存储至内存空间,包括:The method according to claim 1, wherein the storing the target data in the memory space comprises: 对所述目标数据进行分块处理,得到多个目标数据块;performing block processing on the target data to obtain multiple target data blocks; 将所述多个目标数据块平行存储至所述内存空间。storing the multiple target data blocks in parallel in the memory space. 根据权利要求2所述的方法,其特征在于,所述将所述多个目标数据块平行存储至所述内存空间,包括:The method according to claim 2, wherein the storing the multiple target data blocks in parallel in the memory space comprises: 获取所述目标数据的占用空间;Acquiring the occupied space of the target data; 判断所述占用空间是否超过预设值;judging whether the occupied space exceeds a preset value; 当所述占用空间超过所述预设值时,获取存储至所述内存空间的目标数据块的目标数量;When the occupied space exceeds the preset value, acquiring a target number of target data blocks stored in the memory space; 将所述目标数量的所述目标数据块平行存储至所述内存空间。Parallel storing the target number of the target data blocks into the memory space. 根据权利要求3所述的方法,其特征在于,还包括:The method according to claim 3, further comprising: 将剩余的所述目标数据块保存至本地文件;Save the remaining target data blocks to a local file; 判断是否需要调用所述本地文件中的目标数据块;Judging whether the target data block in the local file needs to be called; 当需要调用所述本地文件中的目标数据块时,将所述目标数据块提取至所述内存空间。When the target data block in the local file needs to be called, the target data block is extracted to the memory space. 根据权利要求1所述的方法,其特征在于,所述从所述内存空间提取所述目标数据,包括:The method according to claim 1, wherein said extracting said target data from said memory space comprises: 响应于数据访问请求,确定所述数据访问请求对应的目标数据;In response to a data access request, determine target data corresponding to the data access request; 从所述内存空间中提取所述目标数据。Extracting the target data from the memory space. 根据权利要求5所述的方法,其特征在于,所述从所述内存空间中提取所述目标数据,包括:The method according to claim 5, wherein said extracting said target data from said memory space comprises: 获取数据提取的起始点和结束点;Get the start and end points of the data extraction; 基于所述起始点和所述结束点,从所述内存空间中提取所述起始点和所述结束点之间的数据,得到所述目标数据。Based on the starting point and the ending point, extract data between the starting point and the ending point from the memory space to obtain the target data. 根据权利要求1所述的方法,其特征在于,所述获取服务器对应的目标数据,包括:The method according to claim 1, wherein said obtaining the target data corresponding to the server comprises: 向所述服务器发送数据请求信息;sending data request information to the server; 接收所述服务器下发的对应于所述数据请求信息的目标数据。receiving the target data corresponding to the data request information issued by the server. 一种内存共享装置,其特征在于,包括:A memory sharing device, characterized in that it comprises: 获取模块,用于获取服务器对应的目标数据;An acquisition module, configured to acquire target data corresponding to the server; 存储模块,用于将所述目标数据存储至内存空间;a storage module, configured to store the target data into a memory space; 提取模块,用于当检测到需要调用所述目标数据时,则从所述内存空间提取所述目标数据。An extracting module, configured to extract the target data from the memory space when it is detected that the target data needs to be called. 一种电子设备,其特征在于,包括:An electronic device, characterized in that it comprises: 存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行权利要求1-7任一项所述的内存共享方法。A memory and a processor, the memory and the processor are connected in communication with each other, and computer instructions are stored in the memory, and the processor executes the computer instructions to implement any one of claims 1-7. The memory sharing method described above. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质存储有计算机指令,所述计算机指令用于使计算机执行权利要求1-7任一项所述的内存共享方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer instructions, and the computer instructions are used to make a computer execute the memory sharing method according to any one of claims 1-7.
PCT/CN2022/109319 2021-08-02 2022-07-31 Memory sharing method and apparatus, electronic device, and readable storage medium Ceased WO2023011388A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110880399.7A CN113485855B (en) 2021-08-02 2021-08-02 Memory sharing method, device, electronic device and readable storage medium
CN202110880399.7 2021-08-02

Publications (1)

Publication Number Publication Date
WO2023011388A1 true WO2023011388A1 (en) 2023-02-09

Family

ID=77943870

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/109319 Ceased WO2023011388A1 (en) 2021-08-02 2022-07-31 Memory sharing method and apparatus, electronic device, and readable storage medium

Country Status (2)

Country Link
CN (1) CN113485855B (en)
WO (1) WO2023011388A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113485855B (en) * 2021-08-02 2024-05-10 安徽文香科技股份有限公司 Memory sharing method, device, electronic device and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6014730A (en) * 1996-12-26 2000-01-11 Nec Corporation Dynamic adding system for memory files shared among hosts, dynamic adding method for memory files shared among hosts, and computer-readable medium recording dynamic adding program for memory files shared among hosts
CN112905354A (en) * 2019-12-03 2021-06-04 中国移动通信集团浙江有限公司 Service processing method and system for shared memory
CN113176958A (en) * 2021-04-29 2021-07-27 深信服科技股份有限公司 Memory sharing method, device, equipment and storage medium
CN113485855A (en) * 2021-08-02 2021-10-08 安徽文香科技有限公司 Memory sharing method and device, electronic equipment and readable storage medium

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729595A (en) * 2009-11-26 2010-06-09 世导数据通讯(杭州)有限公司 Network backup device and backup method thereof
CN107273378B (en) * 2016-04-07 2021-01-01 创新先进技术有限公司 File storage method and device
CN106897231B (en) * 2017-02-28 2021-01-12 苏州浪潮智能科技有限公司 Data caching method and system based on high-performance storage medium
CN109117303B (en) * 2018-03-02 2019-03-29 深圳海天力电子商务有限公司 Computer shared file emergency backup platform
JP7245727B2 (en) * 2019-06-18 2023-03-24 Jfeシステムズ株式会社 Data management and storage method, data management and storage device, and computer program for implementing them
CN110263006A (en) * 2019-06-25 2019-09-20 上海连尚网络科技有限公司 A kind of method and apparatus for downloading file on a user device
CN112015458B (en) * 2020-08-04 2024-11-05 上海艾拉比智能科技有限公司 Device upgrade method, terminal device, electronic device and storage medium
CN111930513B (en) * 2020-08-31 2023-02-28 Oppo(重庆)智能科技有限公司 File pre-reading adjusting method and device, electronic equipment and storage medium
CN112799595B (en) * 2021-02-02 2023-06-23 联想(北京)有限公司 Data processing method, device and storage medium
CN113110800B (en) * 2021-04-12 2025-05-02 百度在线网络技术(北京)有限公司 Data processing method, device, electronic device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6014730A (en) * 1996-12-26 2000-01-11 Nec Corporation Dynamic adding system for memory files shared among hosts, dynamic adding method for memory files shared among hosts, and computer-readable medium recording dynamic adding program for memory files shared among hosts
CN112905354A (en) * 2019-12-03 2021-06-04 中国移动通信集团浙江有限公司 Service processing method and system for shared memory
CN113176958A (en) * 2021-04-29 2021-07-27 深信服科技股份有限公司 Memory sharing method, device, equipment and storage medium
CN113485855A (en) * 2021-08-02 2021-10-08 安徽文香科技有限公司 Memory sharing method and device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN113485855B (en) 2024-05-10
CN113485855A (en) 2021-10-08

Similar Documents

Publication Publication Date Title
CN107832100B (en) APK plug-in loading method and terminal thereof
CN112069034B (en) Fast application exception handling method and device, electronic equipment and storage medium
CN106776093A (en) A kind of application exception log processing method and system
WO2019019645A1 (en) Method and apparatus for executing information pushing task, and computer device and storage medium
EP3163946A1 (en) Information transmission method and apparatus, device, computer program and recording medium
CN110968331B (en) Methods and devices for running applications
CN112269622B (en) Page management method, device, equipment and medium
CN110677493A (en) Service state determination method and device, computer device and storage medium
US20240388528A1 (en) Method and apparatus for processing flow table entry in flow table
CN115208951A (en) Request processing method and device, electronic equipment and computer readable storage medium
CN110232022A (en) Network environment test method, device and terminal device
CN115643294A (en) Vehicle control method, apparatus, system, and storage medium
CN115469964A (en) Method and device for determining mapping relationship between block device and virtual machine drive letter
WO2023011388A1 (en) Memory sharing method and apparatus, electronic device, and readable storage medium
CN108804711B (en) A data processing method, device and computer-readable storage medium
CN115390991A (en) Virtual machine import and export method, device, equipment and storage medium
CN114697888B (en) 5G message processing method, device and storage medium
CN113448999A (en) Data acquisition method, device, equipment and readable storage medium
CN114051024B (en) File background continuous transmission method and device, storage medium and electronic equipment
CN114443761A (en) Session process distributed cache synchronization method, device and equipment
CN111580987B (en) Remote procedure call method, device, storage medium and terminal device
CN117081952A (en) Method and device for visualizing network access relationship and electronic equipment
CN116932248A (en) Event processing method and device based on threads and coroutines and terminal equipment
CN116880870A (en) An SDK update method, device and electronic equipment
WO2018201993A1 (en) Image drawing method, terminal and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22852101

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22852101

Country of ref document: EP

Kind code of ref document: A1