CN112463263A - Program running method and device, electronic equipment and computer readable storage medium - Google Patents

Program running method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN112463263A
CN112463263A CN202011412946.0A CN202011412946A CN112463263A CN 112463263 A CN112463263 A CN 112463263A CN 202011412946 A CN202011412946 A CN 202011412946A CN 112463263 A CN112463263 A CN 112463263A
Authority
CN
China
Prior art keywords
data
exclusive
target program
read
resource
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
CN202011412946.0A
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.)
Beijing Yuanxin Science and Technology Co Ltd
Original Assignee
Beijing Yuanxin Science and 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 Beijing Yuanxin Science and Technology Co Ltd filed Critical Beijing Yuanxin Science and Technology Co Ltd
Priority to CN202011412946.0A priority Critical patent/CN112463263A/en
Publication of CN112463263A publication Critical patent/CN112463263A/en
Pending legal-status Critical Current

Links

Images

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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4482Procedural
    • 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/54Interprogram communication
    • G06F9/544Buffers; Shared memory; Pipes

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The embodiment of the application provides a program running method and device, electronic equipment and a computer readable storage medium. The method comprises the following steps: calling a target program, and running the target program in a process mode, wherein the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following items: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the exclusive resources comprise data addresses, data sizes and access rules of corresponding data types, wherein the exclusive resources of the read-write data and the exclusive resources of the read-write stack data are located in the same address space; running the target program in a process mode, wherein the process mode comprises the following steps: the target program is run by accessing the exclusive resources in the preset address space. According to the technical scheme of the embodiment of the application, the utilization rate of the memory protection unit is improved.

Description

Program running method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer application technologies, and in particular, to a program running method and apparatus, an electronic device, and a computer-readable storage medium.
Background
With the progress and development of computer technology, devices such as terminals and the like have been applied to various fields. Different terminals can be equipped with different Systems, for example, the terminals can be equipped with embedded RTOS (Real Time Operating Systems), the MCU (micro controller Unit) of the terminal running the embedded RTOS is usually simpler, there is no MMU (Memory Management Unit) on the hardware, and all the codes run on the physical address. An MPU (Memory protection Unit) can be introduced into the hardware of the terminal, so that the MPU can be used to control the process access authority of the physical Memory.
The number of area regions of the MPU of the MCU is limited, and is usually only 8, and the segments during the process run are sometimes more than 8. Therefore, how to reasonably organize the sections of the program during running and optimize the configuration of the MPU, and the region of the MPU is a great challenge to reasonably use.
Disclosure of Invention
The purpose of the present application is to solve at least one of the above technical drawbacks, and to provide the following solutions:
in a first aspect, a method for running a program is provided, and the method includes:
calling a target program, and running the target program in a process mode, wherein the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the exclusive resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located in the same address space;
the running of the target program in a process mode comprises the following steps:
and running the target program by accessing the exclusive resource in the preset address space.
In a second aspect, there is provided an apparatus for running a program, the apparatus comprising:
the running module is used for calling a target program and running the target program in a process mode, the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the exclusive resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located in the same address space;
the running module is specifically further configured to run the target program by accessing the dedicated resource in the preset address space.
In a third aspect, an electronic device is provided, which includes:
one or more processors;
a memory;
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: a program execution method according to the first aspect of the present application is performed.
In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, which when executed by a processor implements the program execution method shown in the first aspect of the present application.
The beneficial effect that technical scheme that this application provided brought is: the exclusive resource of the read-write data and the exclusive resource of the read-write stack data during the process running are both readable and writable and are not allowed to be executed, so that the exclusive resource of the read-write data and the exclusive resource of the read-write stack data can be positioned in the same address space, the number of used address spaces can be saved, the saved vacant address spaces can enable the process to access other peripheral equipment, and the utilization rate of the memory protection unit is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a program running method according to an embodiment of the present disclosure;
fig. 2 is a schematic diagram illustrating a correspondence relationship between an address interval and a data type in a program running method according to an embodiment of the present application;
fig. 3 is a schematic diagram illustrating a correspondence relationship between an address range and a region of a memory protection unit in a program running method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a program execution device according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device in which a program operates according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The application provides a program running method, a program running device, an electronic device and a computer readable storage medium, which aim to solve the technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The program running method provided by the application can be applied to electronic equipment. Specifically, the electronic device may be a terminal or a server.
When the electronic equipment needs to run a program, a target program is called, the target program is run in a process mode, the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the dedicated resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the dedicated resource for the read-write data and the dedicated resource for the read-write stack data are located in the same address space.
Wherein, the target program is operated in a process mode, and the method comprises the following steps:
the target program is run by accessing the exclusive resources in the preset address space.
Those skilled in the art will appreciate that the "terminal" used herein may be a Mobile phone, a tablet computer, a PDA (Personal Digital Assistant), an MID (Mobile Internet Device), or other terminal Device; a "server" may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
Referring to fig. 1, an embodiment of the present application provides a program running method, where the program running method may be applied to the electronic device, and the method includes:
s101: calling a target program, and running the target program in a process mode, wherein the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the dedicated resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the dedicated resource for the read-write data and the dedicated resource for the read-write stack data are located in the same address space.
Wherein, the target program is operated in a process mode, and the method comprises the following steps:
the target program is run by accessing the exclusive resources in the preset address space.
A process is a running activity of a program in a computer on a data set, is a basic unit for resource allocation and scheduling of a system, and is the basis of an operating system structure.
And calling the target program, and operating the target program in a process mode. The data to which the target program relates, i.e., the kind of the type of the target program including the plurality of types of the exclusive resources is not limited. The target program comprises a data type exclusive resource which comprises at least one of the following items: the target program comprises a dedicated resource for read-only data, a dedicated resource for read-write data and a dedicated resource for read-write stack data.
The target program comprises exclusive resources of read-only data, namely an executable code segment and a read-only data segment of the process of the target program, and the exclusive resources are configured to be read-only and allowed to be executed; the exclusive resource of the readable and writable data included in the target program, namely the data segment of the target program process, includes an initialized data segment and an uninitialized data segment, and is configured to be readable and writable and not allowed to be executed, and the exclusive resource of the readable and writable data is a global variable; the target program includes a dedicated resource for reading and writing stack data, that is, a stack space of a process of the target program itself, which is configured to be readable and writable and not allowed to be executed, and the dedicated resource for reading and writing stack data is a local variable.
The exclusive resource of the read-write data and the exclusive resource of the read-write stack data during the process running are both readable and writable and are not allowed to be executed, so that the exclusive resource of the read-write data and the exclusive resource of the read-write stack data can be positioned in the same address space, the number of used address spaces can be saved, and the saved vacant address space can enable the process to access other peripheral equipment.
The address space is also configured with readable and writable stack data during process shared memory communication, and the configuration mode of the exclusive resource of the readable and writable stack data and the exclusive resource of the readable and writable stack data comprises the following steps:
and configuring the readable and writable stack data during the process shared memory communication, the exclusive resource of the readable and writable data included by the target program and the exclusive resource bit of the readable and writable stack data included by the target program in the same address space.
The readable and writable stack data during the process sharing memory communication, the exclusive resource of the readable and writable data during the process running and the exclusive resource of the readable and writable stack data are all readable and writable and are not allowed to be executed, so that the readable and writable stack data, the exclusive resource of the readable and writable data and the exclusive resource of the readable and writable stack data during the process sharing memory communication are configured in the same address space, the number of used address spaces can be further saved, and the saved vacant address space can enable the process to access more peripherals.
Referring to fig. 2, in the present application, the default address space may be a region in the MPU. Each region is a contiguous segment of address space. A first address interval, a second address interval, a third address interval, a fourth address interval, a fifth address interval, a sixth address interval, a seventh address interval and an eighth address interval are divided in a preset address space.
The method for pre-configuring the dedicated resource of each data type in the preset address space includes:
configuring exclusive resources of read-only data included by the target program in advance in the first address interval;
pre-configuring common resources of read-only data of the target program and other programs in the second address interval;
common resources for reading and writing data of the target program and other programs are configured in advance in the third address interval;
the exclusive resource of the readable and writable data included by the target program, the exclusive resource of the readable and writable stack data included by the target program and the readable and writable stack data during the process sharing memory communication are configured in advance in the fourth address interval;
pre-configuring a first peripheral resource in a fifth address interval;
pre-configuring a second external resource in a sixth address interval;
a third peripheral resource is pre-configured in the seventh address interval;
and a fourth external resource is configured in advance in the eighth address interval.
Referring to fig. 3, the corresponding position relationship between the first address interval, the second address interval, the third address interval, the fourth address interval, the fifth address interval, the sixth address interval, the seventh address interval, and the eighth address interval and the specific address space of the region is not limited. The exclusive resource of the readable and writable data included by the target program, the exclusive resource of the readable and writable stack data included by the target program and the readable and writable stack data in the process sharing memory communication are located in one region in the memory protection unit. Specifically, in the present application, the first address interval may correspond to region0, that is, region0 in the MPU is configured according to the data address, data size, and access rule of the read-only data included in the program, and the access rule of region0 is generally read-only and allowed to be executed; the second address interval may correspond to region1, that is, region1 in the MPU is configured according to the data address, data size, and access rule of the common resource of the target program; the common resource can be commonly accessed by the target program and other programs, and the access rule of region1 is usually read-only and execution-allowed; the third address interval may correspond to region2, that is, region2 in the MPU is configured according to the data address, data size, and access rule of the common resource of the target program, the common resource may be commonly accessed by the target program and other programs, and the access rule of region2 is usually readable and writable and not allowed to be executed; the fourth address interval may correspond to the region3, and configures the region3 in the MPU according to the data address, the data size, and the access rule of the readable and writable stack data included in the program and according to the data address, the data size, and the access rule of the readable and writable stack data when the processes of the program share memory communication, where the access rule of the region3 is usually readable and writable and is not allowed to be executed; the fifth address interval may correspond to region4, that is, region4 in the MPU is configured according to the data address, the data size, and the access rule of the peripheral resource, and the access rule of region4 is usually readable and writable and is not allowed to be executed; the sixth address interval may correspond to region5, that is, region5 in the MPU is configured according to the data address, data size, and access rule of the peripheral resource, where the access rule of region5 is usually readable and writable and is not allowed to be executed; the seventh address interval may correspond to region6, that is, region6 in the MPU is configured according to the data address, the data size, and the access rule of the peripheral resource, where the access rule of region6 is usually readable and writable and is not allowed to be executed; the eighth address interval may correspond to region7, that is, region7 in the MPU is configured according to the data address, data size, and access rule of the peripheral resource, and the access rule of region7 is usually readable and writable and is not allowed to be executed.
According to the embodiment of the application, the readable and writable stack data during the process sharing memory communication, the exclusive resource of the readable and writable stack data included by the target program and the exclusive resource of the readable and writable stack data included by the target program are located in the same address space, so that the number occupied by the address space is reduced, and the electronic equipment can use more peripherals.
The embodiment of the present application further describes specific settings in which the dedicated resource for the stack data to be read and written, the dedicated resource for the write and read data included in the target program, and the dedicated resource for the stack data to be read and written included in the target program are located in the same address space when the processes share memory communication. In the application, the same address space where the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located is divided into a first part and a second part; wherein, configuring the readable and writable stack data during the process sharing memory communication, the dedicated resource of the readable and writable stack data included by the target program and the dedicated resource bit of the readable and writable stack data included by the target program in the same address space, includes:
configuring exclusive resources which can read and write stack data and are included by the target program in the first part; and the readable and writable stack data is read and written when the exclusive resources of the readable and writable data included by the target program and the process share the memory communication.
Specifically, the exclusive resource of the readable and writable data included in the target program, that is, the readable and writable data segment of the target program process is mainly a global variable, in the present application, the data segment of the process is modified, a structure is defined, and discrete and discontinuous global variables, array or buffer-form global variables, and the like are all used as member variables of the structure, that is, the exclusive resource of the readable and writable data included in the target program is used as the member variables of the structure. When a process is created, 32 bits of data are used for identifying the size of a stack to be applied and the size of a TLS (Task Local Storage), wherein the upper 16 bits are the size of the stack, the lower 16 bits are the size of the TLS, namely, the address space to be applied is divided into two parts, the upper 16 bits address space is the stack, and the lower 16 bits address space is the base address of the TLS, namely, the base address of the TLS is after the stack size space is shifted. And the memory of the structure body and the readable and writable stack data during the process sharing memory communication are distributed in the base address of the TLS, and the process can access the member variable in the structure body. And during inter-process communication, distributing the shared memory from the TLS, finishing the communication, and releasing the shared memory into the TLS.
Referring to fig. 4, an embodiment of the present application provides a program execution device 400, where the program execution device 400 may include:
the running module 401 is configured to call a target program and run the target program in a process manner, where the target program includes multiple types of dedicated resources, and the dedicated resources of each data type are preconfigured in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the dedicated resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the dedicated resource for the read-write data and the dedicated resource for the read-write stack data are located in the same address space.
According to the program running device provided by the embodiment of the application, the exclusive resource of the readable and writable data and the exclusive resource of the readable and writable stack data during the process running are both readable and writable and are not allowed to be executed, so that the exclusive resource of the readable and writable data and the exclusive resource of the readable and writable stack data can be located in the same address space, the number of used address spaces can be saved, the saved vacant address space can enable the process to access other peripherals, and the utilization rate of the memory protection unit is improved.
The running module 401 is further configured to run the target program by accessing the dedicated resource in the preset address space.
The program running apparatus 400 further includes:
the configuration module is configured to configure the readable and writable stack data during the process shared memory communication, the dedicated resource of the readable and writable stack data included in the target program, and the dedicated resource bit of the readable and writable stack data included in the target program in the same address space.
The configuration module is further configured to:
configuring exclusive resources of read-only data included in the target program in advance in the first address interval;
pre-configuring common resources of read-only data of the target program and other programs in the second address interval;
pre-configuring common resources capable of reading and writing data of the target program and other programs in the third address interval;
and presetting exclusive resources of the readable and writable data included by the target program and exclusive resources of the readable and writable stack data included by the target program in the fourth address interval.
Wherein, a fifth address interval, a sixth address interval, a seventh address interval and an eighth address interval are further divided from the preset address space, and the configuration module is further configured to:
pre-configuring a first peripheral resource in the fifth address interval;
pre-configuring a second external resource in the sixth address interval;
a third peripheral resource is pre-configured in the seventh address interval;
and a fourth external resource is configured in advance in the eighth address interval.
When the process is established, dividing the same address space in which the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located into a first part and a second part; the configuration module is further to:
configuring exclusive resources of readable and writable stack data included in a target program in the first part;
and the readable and writable stack data is read and written when the exclusive resources of the readable and writable data included by the target program and the process share the memory communication.
Wherein the read-only data included in the target program comprises executable code and a read-only data segment;
the readable and writable data included in the object program comprise initialized data segments and uninitialized data segments.
The exclusive resource for reading and writing data and the exclusive resource for reading and writing stack data are located in one region in the memory protection unit.
Referring to fig. 5, in an alternative embodiment, an electronic device is provided, and the electronic device 5000 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The Processor 5001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
Bus 5002 can include a path that conveys information between the aforementioned components. The bus 5002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 5002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The Memory 5003 may be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 5003 is used for storing application program codes for executing the present solution, and the execution is controlled by the processor 5001. The processor 5001 is configured to execute application program code stored in the memory 5003 to implement the contents shown in the foregoing method embodiments.
Among them, electronic devices include but are not limited to: a terminal and a server.
An embodiment of the present application provides an electronic device, including: a memory and a processor; at least one program stored in the memory for execution by the processor to implement the corresponding aspects of the foregoing method embodiments, compared with the prior art, can implement: the exclusive resource of the read-write data and the exclusive resource of the read-write stack data during the process running are both readable and writable and are not allowed to be executed, so that the exclusive resource of the read-write data and the exclusive resource of the read-write stack data can be positioned in the same address space, the number of used address spaces can be saved, the saved vacant address spaces can enable the process to access other peripheral equipment, and the utilization rate of the memory protection unit is improved.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the exclusive resource of the read-write data and the exclusive resource of the read-write stack data during the process running are both readable and writable and are not allowed to be executed, so that the exclusive resource of the read-write data and the exclusive resource of the read-write stack data can be located in the same address space, the number of used address spaces can be saved, the saved vacant address space can enable the process to access other peripherals, and the utilization rate of the memory protection unit is improved.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A program execution method, comprising:
calling a target program, and running the target program in a process mode, wherein the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the exclusive resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located in the same address space;
the running of the target program in a process mode comprises the following steps:
and running the target program by accessing the exclusive resource in the preset address space.
2. The program execution method according to claim 1, characterized in that: the address space is also configured with readable and writable stack data during process shared memory communication, and the configuration mode of the exclusive resource of the readable and writable stack data and the exclusive resource of the readable and writable stack data comprises the following steps:
and configuring the readable and writable stack data during the process shared memory communication, the exclusive resource of the readable and writable data included by the target program and the exclusive resource bit of the readable and writable stack data included by the target program in the same address space.
3. The program execution method according to claim 1, characterized in that: the method for pre-configuring the exclusive resource of each data type in the preset address space includes:
a first address interval, a second address interval, a third address interval and a fourth address interval are divided from the preset address space; wherein,
configuring exclusive resources of read-only data included in the target program in advance in the first address interval;
pre-configuring common resources of read-only data of the target program and other programs in the second address interval;
pre-configuring common resources capable of reading and writing data of the target program and other programs in the third address interval;
and presetting exclusive resources of the readable and writable data included by the target program and exclusive resources of the readable and writable stack data included by the target program in the fourth address interval.
4. The program operating method according to claim 3, wherein a fifth address interval, a sixth address interval, a seventh address interval, and an eighth address interval are further divided into the preset address space;
pre-configuring a first peripheral resource in the fifth address interval;
pre-configuring a second external resource in the sixth address interval;
a third peripheral resource is pre-configured in the seventh address interval;
and a fourth external resource is configured in advance in the eighth address interval.
5. The program execution method according to claim 2, characterized in that: when the process is established, dividing the same address space in which the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located into a first part and a second part; the allocating, in the same address space, the readable and writable stack data during the process shared memory communication, the dedicated resource of the readable and writable stack data included in the target program, and the dedicated resource bit of the readable and writable stack data included in the target program includes:
configuring exclusive resources of readable and writable stack data included in a target program in the first part;
and the readable and writable stack data is read and written when the exclusive resources of the readable and writable data included by the target program and the process share the memory communication.
6. The program execution method according to claim 1, characterized in that:
the read-only data included in the target program comprises executable codes and read-only data segments;
the readable and writable data included in the object program comprise initialized data segments and uninitialized data segments.
7. The program operating method according to claim 1, wherein the dedicated resource for the write-readable data and the dedicated resource for the write-readable stack data are located in a region in a memory protection unit.
8. A program execution device characterized by comprising:
the running module is used for calling a target program and running the target program in a process mode, the target program comprises multiple types of exclusive resources, and the exclusive resource of each data type is configured in advance in a preset address space; the target program comprises a data type exclusive resource which comprises at least one of the following: exclusive resources of read-only data, exclusive resources of read-write data and exclusive resources of read-write stack data; the exclusive resource comprises a data address, a data size and an access rule of a corresponding data type, wherein the exclusive resource of the read-write data and the exclusive resource of the read-write stack data are located in the same address space;
the running module is specifically further configured to run the target program by accessing the dedicated resource in the preset address space.
9. An electronic device, comprising:
one or more processors;
a memory;
one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, the one or more programs configured to: executing the program execution method according to any one of claims 1 to 7.
10. A computer-readable storage medium on which a computer program is stored, the program, when executed by a processor, implementing the program execution method of any one of claims 1 to 7.
CN202011412946.0A 2020-12-03 2020-12-03 Program running method and device, electronic equipment and computer readable storage medium Pending CN112463263A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011412946.0A CN112463263A (en) 2020-12-03 2020-12-03 Program running method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011412946.0A CN112463263A (en) 2020-12-03 2020-12-03 Program running method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN112463263A true CN112463263A (en) 2021-03-09

Family

ID=74800094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011412946.0A Pending CN112463263A (en) 2020-12-03 2020-12-03 Program running method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN112463263A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1975935A2 (en) * 2007-03-26 2008-10-01 Hitachi Global Storage Technologies Netherlands B.V. Disk drive device and data rewrite method thereof
CN101840520A (en) * 2009-12-28 2010-09-22 北京握奇数据系统有限公司 Intelligent card and method for accessing flash memory of intelligent card
US20120215989A1 (en) * 2011-02-23 2012-08-23 Freescale Semiconductor, Inc. Memory protection in a data processing system
CN103390181A (en) * 2013-07-03 2013-11-13 南京邮电大学 RFID (radio frequency identification) dynamic tag data processing structure and method
CN104298623A (en) * 2013-07-16 2015-01-21 横河电机株式会社 Electronic device, operating system and access control method
CN106528453A (en) * 2015-09-10 2017-03-22 中国航空工业第六八研究所 Page partition management device and method based on composite scale page
CN111797390A (en) * 2020-07-14 2020-10-20 北京元心科技有限公司 Program running method and device, electronic equipment and computer readable storage medium
CN111984410A (en) * 2020-08-18 2020-11-24 上海睿赛德电子科技有限公司 Memory protection system with low resource occupation in embedded system
CN112424758A (en) * 2018-07-27 2021-02-26 Arm有限公司 Memory protection unit using memory protection table stored in memory system

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1975935A2 (en) * 2007-03-26 2008-10-01 Hitachi Global Storage Technologies Netherlands B.V. Disk drive device and data rewrite method thereof
CN101840520A (en) * 2009-12-28 2010-09-22 北京握奇数据系统有限公司 Intelligent card and method for accessing flash memory of intelligent card
US20120215989A1 (en) * 2011-02-23 2012-08-23 Freescale Semiconductor, Inc. Memory protection in a data processing system
CN103390181A (en) * 2013-07-03 2013-11-13 南京邮电大学 RFID (radio frequency identification) dynamic tag data processing structure and method
CN104298623A (en) * 2013-07-16 2015-01-21 横河电机株式会社 Electronic device, operating system and access control method
CN106528453A (en) * 2015-09-10 2017-03-22 中国航空工业第六八研究所 Page partition management device and method based on composite scale page
CN112424758A (en) * 2018-07-27 2021-02-26 Arm有限公司 Memory protection unit using memory protection table stored in memory system
CN111797390A (en) * 2020-07-14 2020-10-20 北京元心科技有限公司 Program running method and device, electronic equipment and computer readable storage medium
CN111984410A (en) * 2020-08-18 2020-11-24 上海睿赛德电子科技有限公司 Memory protection system with low resource occupation in embedded system

Similar Documents

Publication Publication Date Title
US20140359225A1 (en) Multi-core processor and multi-core processor system
US5907862A (en) Method and apparatus for the sharing of a memory device by multiple processors
CN109901890B (en) Method and device for loading multi-core firmware by controller, computer equipment and storage medium
EP3657337B1 (en) Method, apparatus, device and storage medium for accessing static random access memory
CN105446811A (en) Application process associated starting method and associated starting apparatus
CN113391881B (en) Interrupt management method and device, electronic equipment and computer storage medium
US20210357258A1 (en) Method, device and medium for allocating resource based on type of pci device
CN112256460B (en) Inter-process communication method, inter-process communication device, electronic equipment and computer readable storage medium
CN105468400A (en) Linux user mode based method and system for calling timer
CN111797390B (en) Program running method, program running device, electronic equipment and computer readable storage medium
CN115454512A (en) Chip drive loading configuration method, device, equipment and storage medium
CN102750493B (en) Access right control method, Apparatus and system
CN111124314A (en) SSD performance improving method and device for mapping table dynamic loading, computer equipment and storage medium
KR102563648B1 (en) Multi-processor system and method of operating the same
KR20210011010A (en) Processor Feature ID Response for Virtualization
CN105700942A (en) Associated start method and associated start device for application process
US20140289739A1 (en) Allocating and sharing a data object among program instances
CN116204124B (en) Data processing method and system based on conflict lock and electronic equipment
CN112463263A (en) Program running method and device, electronic equipment and computer readable storage medium
EP4414844A1 (en) Resource sharing method, terminal and computer readable medium
KR20110037492A (en) Multi-port memory system and access control method thereof
CN110231988B (en) Video memory access method and device and storage medium
CN114153560B (en) Virtual interrupt processing method, device, equipment and medium
CN113253939B (en) Data processing method, device, electronic equipment and storage medium
CN113220368B (en) Storage client resource isolation method, system, terminal and storage 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