CN117573331A - Memory control method, device, equipment and medium - Google Patents

Memory control method, device, equipment and medium Download PDF

Info

Publication number
CN117573331A
CN117573331A CN202311288308.6A CN202311288308A CN117573331A CN 117573331 A CN117573331 A CN 117573331A CN 202311288308 A CN202311288308 A CN 202311288308A CN 117573331 A CN117573331 A CN 117573331A
Authority
CN
China
Prior art keywords
data structure
target data
target
memory
determining
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.)
Pending
Application number
CN202311288308.6A
Other languages
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.)
Shanghai Silang Technology Co ltd
Original Assignee
Shanghai Silang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Silang Technology Co ltd filed Critical Shanghai Silang Technology Co ltd
Priority to CN202311288308.6A priority Critical patent/CN117573331A/en
Publication of CN117573331A publication Critical patent/CN117573331A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/5022Mechanisms to release resources
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

The embodiment of the invention discloses a memory control method, a memory control device, memory control equipment and a memory control medium. The method comprises the following steps: acquiring a data structure to be processed; packaging the data structure to be processed to obtain a target data structure; determining a target reference number of the target data structure; and according to the target reference times, intervening the memory use condition of the corresponding target data structure. According to the scheme, the target reference times are introduced, so that the use of the memory is automatically controlled, the control of the memory is not needed to be manually participated, and the use efficiency of the memory is improved. Meanwhile, the embodiment of the invention avoids the possibility of memory leakage, does not need to manually manage the memory, and can automatically release the memory along with the end of the life cycle.

Description

Memory control method, device, equipment and medium
Technical Field
The embodiment of the invention relates to the technical field of memory monitoring, in particular to a memory control method, a device, equipment and a medium.
Background
Good program performance depends in part on its efficient memory management capabilities, whereas the performance of conventional heap memory managers is affected by memory fragmentation and memory reclamation requirements, especially in application environments where memory is frequently allocated and released, more likely to become a bottleneck for system performance. Moreover, potential memory leaks may deplete the long running system memory, resulting in dramatic system performance degradation until a final downtime.
In the prior art, the use of the memory is generally controlled manually. However, the above method may have a low memory use efficiency.
Disclosure of Invention
The invention provides a memory control method, a device, equipment and a medium, which are used for realizing automatic control of the use of a memory and improving the use efficiency of the memory.
According to an aspect of the present invention, there is provided a memory control method, including:
acquiring a data structure to be processed;
packaging the data structure to be processed to obtain a target data structure;
determining a target reference number of the target data structure;
and according to the target reference times, intervening the memory use condition of the corresponding target data structure.
According to another aspect of the present invention, there is provided a memory control apparatus including:
the data structure to be processed acquisition module is used for acquiring the data structure to be processed;
the target data structure determining module is used for carrying out packaging processing on the data structure to be processed to obtain a target data structure;
a target reference number determining module, configured to determine a target reference number of the target data structure;
and the memory intervention module is used for intervening the memory service condition of the corresponding target data structure according to the target reference times.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the memory control method according to any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a memory control method according to any one of the embodiments of the present invention.
The embodiment of the invention provides a memory control method, which comprises the steps of obtaining a data structure to be processed; packaging the data structure to be processed to obtain a target data structure; determining target reference times of a target data structure; and according to the target reference times, intervening the memory use condition of the corresponding target data structure. According to the scheme, the target reference times are introduced, so that the use of the memory is automatically controlled, the control of the memory is not needed to be manually participated, and the use efficiency of the memory is improved. Meanwhile, the embodiment of the invention avoids the possibility of memory leakage, does not need to manually manage the memory, and can automatically release the memory along with the end of the life cycle.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a memory control method according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a memory control method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a memory control device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device for implementing a memory control method according to a fourth embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
Example 1
Fig. 1 is a flowchart of a memory control method according to an embodiment of the present invention, where the method may be performed by a memory control device, the device may be implemented in hardware and/or software, and the device may be configured in an electronic apparatus that carries a memory control function.
Referring to fig. 1, the memory control method includes:
s110, acquiring a data structure to be processed.
The data structure to be processed may refer to a preset data structure. The number and/or type of the data structures to be processed according to the embodiment of the invention are not limited in any way, and can be set by a technician according to experience.
S120, packaging the data structure to be processed to obtain a target data structure.
The target data structure refers to a data structure to be processed after encapsulation. It should be noted that, when the data structure to be processed is encapsulated, the internal structure of the data structure to be processed is not changed.
The embodiment of the invention does not limit the way of packaging the data structure to be processed, and can be set by a technician according to experience. In an alternative embodiment, the encapsulating the data structure to be processed to obtain the target data structure includes: and packaging the data structure to be processed according to the intelligent pointer to obtain a target data structure.
Wherein the intelligent pointer refers to storing a class pointing to a dynamically allocated (heap) object pointer, associating a counter with the object pointed to by the class, and the reference count tracks how many pointers of the class of objects point to the same object. Specifically, the target data structure encapsulated by the intelligent pointer has a counting function.
In the embodiment of the invention, the data structure to be processed can be packaged in a preprocessing or post-processing platform. Specifically, in the embodiment of the invention, the resource is managed by adopting an intelligent pointer, and the resource is managed by adopting a RAII method by adopting the intelligent pointer.
In the embodiment of the invention, the heap memory is used by adopting the variable defined by the intelligent pointer, and the heap memory space is far larger than the heap memory, so that the upper limit of the memory occupation during the program running is greatly expanded.
It can be understood that the intelligent pointer is used for packaging the data structure to be processed, so that the target data structure has a counting function, and the applicability of the target data structure is improved; meanwhile, the mature intelligent pointer is adopted for packaging, so that the packaging success rate is improved, the condition that the internal data of the target data structure changes is avoided, and the accuracy of the target data structure is improved.
S130, determining the target reference times of the target data structure.
The target reference number refers to the number of times the target data structure is finally referenced.
It should be noted that, for any target data structure, the target data structure may be referenced multiple times at the same time, or referenced multiple times at different times, and the target reference times need to be updated in real time to improve the accuracy of the target reference times.
S140, according to the target reference times, intervention is carried out on the memory use condition of the corresponding target data structure.
In the embodiment of the invention, if the target reference number of the target data structure is not 0, the memory of the corresponding target data structure is in an occupied state.
In an alternative embodiment, the intervening on the memory usage of the corresponding target data structure according to the target reference number includes: and if the target reference number is 0, controlling to release the memory of the corresponding target data structure.
It can be understood that when the number of target references is 0, the memory is released, so that the timely release of the memory is realized, and the waste of memory resources is avoided.
The embodiment of the invention provides a memory control method, which comprises the steps of obtaining a data structure to be processed; packaging the data structure to be processed to obtain a target data structure; determining target reference times of a target data structure; and according to the target reference times, intervening the memory use condition of the corresponding target data structure. According to the scheme, the target reference times are introduced, so that the use of the memory is automatically controlled, the control of the memory is not needed to be manually participated, and the use efficiency of the memory is improved. Meanwhile, the embodiment of the invention avoids the possibility of memory leakage, does not need to manually manage the memory, and can automatically release the memory along with the end of the life cycle.
Example two
Fig. 2 is a flowchart of a memory control method according to a second embodiment of the present invention, where the operation of determining the number of target references of a target data structure is further refined to "determine target data stored in the target data structure" based on the above embodiments; and determining the target reference times of the target data structure according to the state of the target data call target data structure so as to perfect a determination mechanism of the target reference times. In the portions of the embodiments of the present invention that are not described in detail, reference may be made to the descriptions of other embodiments.
Referring to fig. 2, the memory control method includes:
s210, acquiring a data structure to be processed.
S220, packaging the data structure to be processed to obtain a target data structure.
S230, determining target data stored in the target data structure.
The target data refers to data needing to call a target data structure.
Specifically, the data of the call target data structure is taken as target data. The embodiment of the invention does not limit the target data at all, and can be set by a technician according to experience.
S240, determining the target reference times of the target data structure according to the state of the target data calling target data structure.
Wherein the state of the target data invoking the target data structure may include the target data structure being invoked and the target data structure being released.
In an alternative embodiment, determining the number of target references to the target data structure based on the state of the target data call target data structure includes: and determining the target reference times of the target data structure according to the calling operation or the releasing operation of the target data to the target data structure.
Where a call operation refers to an operation in which a target data structure is defined, referenced, or copied. The release operation refers to an operation in which the target data structure is deleted or released.
It can be appreciated that determining the number of target references based on the invoking operation or the referencing operation improves the accuracy of the determined number of target references.
In an alternative embodiment, determining the number of target references to the target data structure based on the state of the target data call target data structure includes: determining the current reference times of the target data structure; and determining the target reference times of the target data structure according to the state of the target data call target data structure and the current reference times.
The current reference number refers to the number of times when the target data structure is called or released at the current time.
In another alternative embodiment, determining the number of target references to the target data structure based on the state of the target data call target data structure includes: determining the current calling times and the current releasing times of a target data structure; and determining the target reference times of the target data structure according to the state, the current call times and the current release times of the target data call target data structure.
The current calling times refer to the times of the target data structure being called at the current moment; accordingly, the current release number refers to the number of times that is released at the current time.
It can be understood that by introducing the current calling times and the current releasing times, the referenced state of the target data structure is recorded in real time, and data support is provided for the subsequent understanding of the referenced state of any target data structure.
It should be noted that, in the embodiment of the present invention, a preset reference period may be introduced, and the target reference number of the target data structure is determined according to the preset reference period, the state of calling the target data structure by the target data, the current calling number and the current releasing number. The reference preset reference period has the advantages that the number of target references is not required to be frequently determined, and the waste of resources is reduced. The size of the preset reference period is not limited in the embodiment of the invention, and can be set by a technician according to experience.
In an alternative embodiment, determining the target reference number of the target data structure based on the state of the target data call target data structure and the current reference number includes: if the target data call the target data structure, adding 1 to the current reference number of the target data structure to update the current reference number; if the target data release the target data structure, subtracting 1 from the current reference number of the target data structure to update the current reference number; and determining the target reference times according to the updated current reference times.
Specifically, if the target data structure is called at the current moment, adding 1 to the current reference number of the target data structure; if the target data structure is released at the current moment, subtracting 1 from the current reference number of the target data structure; the update of the current reference times is realized through the two modes, and the target reference times are obtained.
Further, when the number of target references is 0, the memory corresponding to the target data structure may be released.
It can be understood that the target reference times are obtained by updating the current reference times, so that the situation that the target reference times are not updated in time is avoided, and the accuracy of determining the target reference times is improved.
In an alternative embodiment, determining the target reference number of the target data structure according to the state, the current call number and the current release number of the target data call target data structure includes: if the target data call the target data structure, adding 1 to the current call times to update the current call times; and determining the target reference times according to the current release times and the updated current call times.
Specifically, determining the target reference number according to the current release number and the updated current call number includes: making a difference between the current release times and the updated current calling times; and determining the target reference times according to the obtained absolute value of the difference.
In an alternative embodiment, determining the target reference number of the target data structure according to the state, the current call number and the current release number of the target data call target data structure includes: if the target data release the target data structure, adding 1 to the current release times to update the current release times; and determining the target reference times according to the current calling times and the updated current release times.
Specifically, determining the target reference number according to the current call number and the updated current release number includes: making a difference between the current calling times and the updated current release times; and determining the target reference times according to the obtained absolute value of the difference.
S250, according to the target reference times, intervention is carried out on the memory use condition of the corresponding target data structure.
The embodiment of the invention provides a memory control scheme, which refines the operation of determining the target reference times of a target data structure into the target data stored in the target data structure; and determining the target reference times of the target data structure according to the state of the target data calling target data structure, and perfecting a determination mechanism of the target reference times. According to the scheme, the target reference times are determined by introducing the state of the target data structure, and the accuracy of the determined target reference times is improved.
On the basis of the technical scheme, when the intelligent pointer is adopted to package the data structure to be processed, the intelligent pointer uses a RAII method to manage the memory, and the basic principle of the RAII is that when the scope of the program variable is ended, the data type defined by the intelligent pointer is destructed, and at the moment, the reference count atom is self-subtracted; when a program variable is defined, referenced, or copied, the reference count may atomically self-increment. The reference number is 1 when the object is initially created (i.e. the current reference number is 1 when the object data structure is initially created), the reference count is increased by 1 when the object is used (i.e. the current reference number is increased by 1 when the object data structure is called), the reference count is decreased by 1 when the object is released (i.e. the current application number is decreased by 1 when the object data structure is released), and the memory is released until the reference number is 0, so that the memory release can be automatically managed, and the occurrence of empty pointer faults is avoided.
Example III
Fig. 3 is a schematic structural diagram of a memory control device according to a third embodiment of the present invention. The embodiment is applicable to the case of intervening the use condition of the memory, the method can be executed by a memory control device, the device can be implemented in a form of hardware and/or software, and the device can be configured in an electronic device carrying the memory control function.
As shown in fig. 3, the apparatus includes: a pending data structure acquisition module 310, a target data structure determination module 320, a target reference number determination module 330, and a memory intervention module 340. Wherein,
a pending data structure acquisition module 310, configured to acquire a pending data structure;
the target data structure determining module 320 is configured to perform packaging processing on the data structure to be processed to obtain a target data structure;
a target reference number determination module 330, configured to determine a target reference number of the target data structure;
and the memory intervention module 340 is configured to intervene in the memory usage situation of the corresponding target data structure according to the target reference times.
The embodiment of the invention provides a memory control method, which comprises the steps of acquiring a data structure to be processed through a data structure acquisition module to be processed; the method comprises the steps that a target data structure determining module is used for packaging a data structure to be processed to obtain a target data structure; determining the target reference times of the target data structure through a target reference times determining module; and intervention is carried out on the memory service condition of the corresponding target data structure according to the target reference times through a memory intervention module. According to the scheme, the target reference times are introduced, so that the use of the memory is automatically controlled, the control of the memory is not needed to be manually participated, and the use efficiency of the memory is improved. Meanwhile, the embodiment of the invention avoids the possibility of memory leakage, does not need to manually manage the memory, and can automatically release the memory along with the end of the life cycle.
Optionally, the target reference number determining module 330 includes:
a target data determining unit, configured to determine target data stored in the target data structure;
and the target reference number determining unit is used for determining the target reference number of the target data structure according to the state of the target data calling the target data structure.
Optionally, the target reference number determining unit includes:
and the target reference number determining subunit is used for determining the target reference number of the target data structure according to the calling operation or the releasing operation of the target data on the target data structure.
Optionally, the target reference number determining unit includes:
a current reference number determining subunit, configured to determine a current reference number of the target data structure;
and the target reference number determining subunit is used for determining the target reference number of the target data structure according to the state of the target data calling the target data structure and the current reference number.
Optionally, the target reference number determining subunit is specifically configured to:
if the target data call the target data structure, adding 1 to the current reference number of the target data structure to update the current reference number;
if the target data release the target data structure, subtracting 1 from the current reference number of the target data structure to update the current reference number;
and determining the target reference times according to the updated current reference times.
Optionally, the memory intervention module 340 includes:
and the memory releasing unit is used for controlling and releasing the memory of the corresponding target data structure if the target reference number is 0.
Optionally, the target data structure determination module 320 includes:
and the target data structure determining unit is used for packaging the data structure to be processed according to the intelligent pointer to obtain the target data structure.
The memory control device provided by the embodiment of the invention can execute the memory control method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the memory control methods.
In the technical scheme of the invention, the related processes of collecting, storing, using, processing, transmitting, providing, disclosing and the like of the data structure to be processed, the intelligent pointer and the like all accord with the regulations of related laws and regulations, and the public sequence is not violated.
Example IV
Fig. 4 is a schematic structural diagram of an electronic device for implementing a memory control method according to a fourth embodiment of the present invention. The electronic device 410 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 410 includes at least one processor 411, and a memory, such as a Read Only Memory (ROM) 412, a Random Access Memory (RAM) 413, etc., communicatively connected to the at least one processor 411, wherein the memory stores computer programs executable by the at least one processor, and the processor 411 may perform various suitable actions and processes according to the computer programs stored in the Read Only Memory (ROM) 412 or the computer programs loaded from the storage unit 418 into the Random Access Memory (RAM) 413. In the RAM 413, various programs and data required for the operation of the electronic device 410 may also be stored. The processor 411, the ROM 412, and the RAM 413 are connected to each other through a bus 414. An input/output (I/O) interface 415 is also connected to bus 414.
Various components in the electronic device 410 are connected to the I/O interface 415, including: an input unit 416 such as a keyboard, a mouse, etc.; an output unit 417 such as various types of displays, speakers, and the like; a storage unit 418, such as a magnetic disk, optical disk, or the like; and a communication unit 419 such as a network card, modem, wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The processor 411 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 411 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 411 performs the various methods and processes described above, such as memory control methods.
In some embodiments, the memory control method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 418. In some embodiments, some or all of the computer program may be loaded and/or installed onto the electronic device 410 via the ROM 412 and/or the communication unit 419. When the computer program is loaded into RAM 413 and executed by processor 411, one or more steps of the memory control method described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured to perform the memory control method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A memory control method, comprising:
acquiring a data structure to be processed;
packaging the data structure to be processed to obtain a target data structure;
determining a target reference number of the target data structure;
and according to the target reference times, intervening the memory use condition of the corresponding target data structure.
2. The method of claim 1, wherein the determining the target reference number of the target data structure comprises:
determining target data stored by the target data structure;
and determining the target reference times of the target data structure according to the state of the target data calling the target data structure.
3. The method of claim 2, wherein determining the number of target references to the target data structure based on the state of the target data call to the target data structure comprises:
and determining the target reference times of the target data structure according to the calling operation or the releasing operation of the target data to the target data structure.
4. A method according to claim 3, wherein said determining the number of target references to the target data structure based on the state of the target data call to the target data structure comprises:
determining the current reference times of the target data structure;
and determining the target reference times of the target data structure according to the state of the target data call of the target data structure and the current reference times.
5. The method of claim 4, wherein determining the target number of references to the target data structure based on the state of the target data call to the target data structure and the current number of references comprises:
if the target data call the target data structure, adding 1 to the current reference number of the target data structure to update the current reference number;
if the target data release the target data structure, subtracting 1 from the current reference number of the target data structure to update the current reference number;
and determining the target reference times according to the updated current reference times.
6. The method according to any one of claims 1-5, wherein the intervening on the memory usage of the corresponding target data structure according to the target reference number includes:
and if the target reference times are 0, controlling to release the memory of the corresponding target data structure.
7. The method according to any one of claims 1-5, wherein the encapsulating the data structure to be processed to obtain a target data structure includes:
and packaging the data structure to be processed according to the intelligent pointer to obtain the target data structure.
8. A memory control device, comprising:
the data structure to be processed acquisition module is used for acquiring the data structure to be processed;
the target data structure determining module is used for carrying out packaging processing on the data structure to be processed to obtain a target data structure;
a target reference number determining module, configured to determine a target reference number of the target data structure;
and the memory intervention module is used for intervening the memory service condition of the corresponding target data structure according to the target reference times.
9. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a memory control method as recited in any of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a memory control method as claimed in any one of claims 1-7.
CN202311288308.6A 2023-10-07 2023-10-07 Memory control method, device, equipment and medium Pending CN117573331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311288308.6A CN117573331A (en) 2023-10-07 2023-10-07 Memory control method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311288308.6A CN117573331A (en) 2023-10-07 2023-10-07 Memory control method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117573331A true CN117573331A (en) 2024-02-20

Family

ID=89886925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311288308.6A Pending CN117573331A (en) 2023-10-07 2023-10-07 Memory control method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117573331A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118193227A (en) * 2024-05-17 2024-06-14 杭州摩西科技发展有限公司 Memory management optimization method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118193227A (en) * 2024-05-17 2024-06-14 杭州摩西科技发展有限公司 Memory management optimization method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN112540806A (en) Applet page rendering method and device, electronic equipment and storage medium
CN117573331A (en) Memory control method, device, equipment and medium
CN112905314A (en) Asynchronous processing method and device, electronic equipment, storage medium and road side equipment
CN116150051A (en) Command processing method, device and system
CN117236236B (en) Chip design data management method and device, electronic equipment and storage medium
CN112883041B (en) Data updating method and device, electronic equipment and storage medium
CN116661960A (en) Batch task processing method, device, equipment and storage medium
CN115426287B (en) System monitoring and optimizing method and device, electronic equipment and medium
CN116860751A (en) Data processing method and device, electronic equipment and storage medium
CN116594563A (en) Distributed storage capacity expansion method and device, electronic equipment and storage medium
CN115103024B (en) Sequence number generation method and device, electronic equipment and storage medium
CN117827949A (en) Method and device for batch writing of data into database based on memory queue
CN112596922B (en) Communication management method, device, equipment and medium
CN117075920A (en) Optimization method and device for application program installation package
CN115098520A (en) Device data updating method and device, electronic device and storage medium
CN117009000A (en) Component, method, device, apparatus and medium for operating open source buddha system
CN114217947A (en) Task execution method and device, electronic equipment and readable storage medium
CN117156398A (en) Message processing method, device, electronic equipment and storage medium
CN117555830A (en) Flow control method, device, chip and storage medium
CN117331944A (en) Database table generation method, device, equipment and storage medium
CN114844920A (en) Internet of things equipment checking method and device, electronic equipment and storage medium
CN117931477A (en) Interaction method, device, electronic equipment and storage medium
CN117933353A (en) Reinforced learning model training method and device, electronic equipment and storage medium
CN116431578A (en) File cleaning method and device, electronic equipment and storage medium
CN116954922A (en) Distributed storage method, device, equipment and medium

Legal Events

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