CN115686817A - Method and device for acquiring system stack utilization rate, electronic equipment and storage medium - Google Patents

Method and device for acquiring system stack utilization rate, electronic equipment and storage medium Download PDF

Info

Publication number
CN115686817A
CN115686817A CN202110875512.2A CN202110875512A CN115686817A CN 115686817 A CN115686817 A CN 115686817A CN 202110875512 A CN202110875512 A CN 202110875512A CN 115686817 A CN115686817 A CN 115686817A
Authority
CN
China
Prior art keywords
stack
data
address
initial data
system stack
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
CN202110875512.2A
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.)
Qingdao Haier Smart Technology R&D Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Smart Technology R&D Co Ltd
Haier Smart Home 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 Qingdao Haier Smart Technology R&D Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Smart Technology R&D Co Ltd
Priority to CN202110875512.2A priority Critical patent/CN115686817A/en
Publication of CN115686817A publication Critical patent/CN115686817A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application relates to the technical field of computers, and discloses a method for acquiring system stack utilization rate, which comprises the following steps: filling a system stack by using preset initial data; acquiring the number of stack data different from the initial data in a system stack; and determining the utilization rate of the system stack according to the quantity. Because the system stack is filled by utilizing the preset initial data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data by determining the number of the stack data different from the initial data, so that the service condition of the system stack is obtained, and a user can take preventive measures conveniently. The application also discloses a device for acquiring the utilization rate of the system stack, electronic equipment and a storage medium.

Description

Method and device for acquiring system stack utilization rate, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for obtaining system stack utilization, an electronic device, and a storage medium.
Background
The embedded system often has system crash caused by insufficient resources, the resources comprise a stack, a heap, a memory and the like, wherein the stack is particularly important, and the stack stores local variables and parameters of a system call function. After the function is released, the resource is automatically released, if nested calling, recursive calling, a local array is huge and the like occur, the space of the stack may be increased rapidly, and finally the system is crashed, so that the utilization rate of the system stack needs to be detected in real time, a user can take preventive measures conveniently, and the normal operation of the embedded system is ensured.
In the process of implementing the embodiment of the present disclosure, it is found that it is inconvenient for a user to take preventive measures because the usage of the system stack cannot be obtained in the related art.
Disclosure of Invention
The following presents a simplified summary in order to provide a basic understanding of some aspects of the disclosed embodiments. This summary is not an extensive overview and is intended to neither identify key/critical elements nor delineate the scope of such embodiments, but is intended to be a prelude to the more detailed description that is presented later.
The embodiment of the disclosure provides a method and a device for acquiring the utilization rate of a system stack, electronic equipment and a storage medium, so as to acquire the use condition of the system stack.
In some embodiments, the method for obtaining system stack usage includes: filling a system stack by using preset initial data; acquiring the number of stack data different from the initial data in the system stack; and determining the utilization rate of the system stack according to the number.
In some embodiments, the means for obtaining system stack usage comprises: a filling module configured to fill up the system stack with preset initial data; an obtaining module configured to obtain the number of stack data in the system stack that is different from the initial data; a determining module configured to determine a usage rate of the system stack according to the number.
In some embodiments, the apparatus for obtaining system stack usage comprises a processor and a memory storing program instructions, the processor being configured to, when executing the program instructions, perform the above-described method for obtaining system stack usage.
In some embodiments, the electronic device includes the above-mentioned means for acquiring system stack usage.
In some embodiments, the storage medium stores program instructions that, when executed, perform the above-described method for obtaining system stack usage.
The method and the device for acquiring the system stack utilization rate, the electronic device and the storage medium provided by the embodiment of the disclosure can achieve the following technical effects: filling a system stack by using preset initial data; acquiring the number of stack data different from the initial data in a system stack; and determining the utilization rate of the system stack according to the quantity. Because the system stack is filled by utilizing the preset initial data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data by determining the number of the stack data different from the initial data, so that the service condition of the system stack is obtained, and a user can take preventive measures conveniently.
The foregoing general description and the following description are exemplary and explanatory only and are not restrictive of the application.
Drawings
One or more embodiments are illustrated by way of example in the accompanying drawings, which correspond to the accompanying drawings and not in limitation thereof, in which elements having the same reference numeral designations are shown as like elements and not in limitation thereof, and wherein:
fig. 1 is a schematic diagram of a method for obtaining usage rate of a system stack according to an embodiment of the present disclosure;
FIG. 2 is a diagram illustrating a search area determined in a system stack according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a search area determined in another system stack provided by an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of determining a seek stop address in a system stack according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an apparatus for obtaining system stack utilization according to an embodiment of the present disclosure;
fig. 6 is a schematic diagram of another apparatus for acquiring system stack utilization according to an embodiment of the present disclosure.
Detailed Description
So that the manner in which the features and elements of the disclosed embodiments can be understood in detail, a more particular description of the disclosed embodiments, briefly summarized above, may be had by reference to the embodiments, some of which are illustrated in the appended drawings. In the following description of the technology, for purposes of explanation, numerous details are set forth in order to provide a thorough understanding of the disclosed embodiments. However, one or more embodiments may be practiced without these details. In other instances, well-known structures and devices may be shown in simplified form in order to simplify the drawing.
The terms "first," "second," and the like in the description and in the claims, and the above-described drawings of embodiments of the present disclosure, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the present disclosure described herein may be made. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions.
The term "plurality" means two or more, unless otherwise specified.
In the embodiment of the present disclosure, the character "/" indicates that the preceding and following objects are in an or relationship. For example, A/B represents: a or B.
The term "and/or" is an associative relationship that describes objects, meaning that three relationships may exist. For example, a and/or B, represents: a or B, or A and B.
As shown in fig. 1, an embodiment of the present disclosure provides a method for obtaining a usage rate of a system stack, including:
step S101, filling the system stack with preset initial data.
Step S102, acquiring the number of stack data different from the initial data in the system stack.
And step S103, determining the utilization rate of the system stack according to the number of stack data different from the initial data in the system stack.
By adopting the method for acquiring the utilization rate of the system stack provided by the embodiment of the disclosure, the system stack is filled by utilizing preset initial data; acquiring the number of stack data different from the initial data in a system stack; and determining the utilization rate of the system stack according to the quantity. Because the system stack is filled by using the preset initial data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data by determining the number of the stack data different from the initial data, so that the service condition of the system stack is obtained, and a user can take preventive measures conveniently.
In some embodiments, the initial data is {0xDE,0xAE,0xBE,0xEF }, and the size of the initial data {0xDE,0xAE,0xBE,0xEF } is 4, since the predetermined initial data is data with specificity, it is convenient to distinguish the stack data from the initial data.
Optionally, the obtaining of the amount of stack data in the system stack, which is different from the initial data, includes: determining a first stack address to be detected corresponding to a system stack, and acquiring stack data corresponding to the first stack address to be detected; comparing stack data corresponding to the first stack address to be detected with the initial data to obtain a comparison result; determining a search area according to the comparison result; and determining the number of stack data different from the initial data in the system stack according to the search area.
Optionally, determining a first to-be-detected stack address corresponding to the system stack includes: obtaining a first stack address to be detected by calculating StackTestAddress = the StackStartAddress + (MidPattern number-1) × the Pattern size; wherein, the StackTestAddress is the first stack address to be detected, the stackstartaddress is the initial address of the system stack, the midpattern number is the data group number of the initial data of the middle point of the system stack, and the pattern size is the size of the initial data.
Optionally by calculation
Figure BDA0003190139320000041
Obtaining the data group number of the initial data of the intermediate point of the search area of the system stack, wherein StartPatterNumber is the data group of the first group of initial data filled in the search area of the system stackNumber, i.e., startplayrnnumber =0; endPattern number is the data group number of the last set of initial data populated in the lookup area of the system stack. Alternatively, the first and second liquid crystal display panels may be,
Figure BDA0003190139320000042
to perform the rounding-down operation for (StartPatterNumber + EndPattern Number)/2.
In some embodiments, initial data, for a total of 100 sets, then startpatternnnumber =0, endpatternnnumber =99;
Figure BDA0003190139320000043
optionally, the obtaining stack data corresponding to the first stack address to be detected includes: and extracting stack data corresponding to the first stack address to be detected from the first stack address to be detected.
Therefore, the system stack is filled by utilizing the preset initial data, because the initial data of the corresponding address can be rewritten into the stack data under the condition that the space of the system stack is used, the number of the stack data which are different from the initial data in the system stack is obtained by comparing the initial data of the same address with the stack data, the utilization rate of the system stack can be determined according to the number of the stack data which are different from the initial data and the total number of the initial data, and therefore the service condition of the system stack is obtained, and a user can take preventive measures conveniently.
Optionally, determining the search area according to the comparison result includes: determining the first stack address to be detected as an alternative termination address and acquiring an initial address of a system stack under the condition that the comparison result is that stack data corresponding to the first stack address to be detected is the same as the initial data; and determining a system stack area between the starting address and the alternative terminating address as a search area.
In some embodiments, referring to fig. 2, fig. 2 is a schematic diagram of a lookup area determined from a system stack when stack data corresponding to a first stack address to be detected is the same as initial data, where the lookup area is a system stack area between a start address and an alternative end address, that is, the first stack address to be detected, and a direction of an arrow in fig. 2 represents a growing direction of the system stack.
Optionally, determining the search area according to the comparison result includes: determining the first stack address to be detected as an alternative initial address and acquiring the growth direction of the system stack under the condition that the comparison result is that the stack data corresponding to the first stack address to be detected is different from the initial data; and determining a system stack area in the same direction along the growing direction from the alternative starting address as a search area.
In some embodiments, referring to fig. 3, fig. 3 is a schematic diagram of a search area determined from the system stack when stack data corresponding to the first to-be-detected stack address is different from the initial data, where the search area is a system stack area that starts from the alternative start address, that is, the first to-be-detected stack address, and is in the same direction as the growth direction, and the direction of an arrow in fig. 3 represents the growth direction of the system stack.
Optionally, determining the number of stack data in the system stack, which is different from the initial data, according to the search area includes: determining a search stop address from the search area; the stack data corresponding to the search stop address is different from the initial data, and the previous group of stack data of the search stop address along the same direction as the growth direction is the same as the initial data; acquiring a data group number of initial data corresponding to the search stop address; the data group number is determined as the amount of stack data in the system stack that is not identical to the initial data.
Optionally, determining a search stop address from the search area includes: determining a second stack address to be detected corresponding to the search area; and determining the stack address to be detected as the search stop address under the condition that the second stack address to be detected meets the preset condition.
Optionally, satisfying the preset condition includes: the stack data corresponding to the second stack address to be detected is different from the initial data, and the previous group of stack data of the second stack address to be detected along the same direction as the growth direction is the same as the initial data.
Optionally, the data group number of the initial data corresponding to the search stop address is the nth group of initial data filled into the system stack. For example, if the 23 rd initial data is filled into the system stack, the data set number of the initial data is 23.
Optionally, determining the data group number as the number of stack data in the system stack different from the initial data includes: and if the data group number of the initial data corresponding to the search stop address is 23, determining 23 as the number of stack data different from the initial data in the system stack.
In some embodiments, it is determined from the search area that stack data corresponding to the search stop address is different from the initial data, a data group number of the initial data is 23 th group of initial data, and a previous group of stack data of the search stop address in the same direction as the growth direction is the same as the initial data, that is, the stack data corresponding to the search stop address is the same as the 24 th group of initial data; then 23 is determined as the amount of stack data in the system stack that is not identical to the initial data.
In some embodiments, a first to-be-detected stack address corresponding to a system stack is determined, and stack data corresponding to the first to-be-detected stack address is acquired; comparing stack data corresponding to the first stack address to be detected with the initial data to obtain a comparison result; under the condition that the comparison result is that stack data corresponding to the first stack address to be detected is the same as the initial data, determining the first stack address to be detected as an alternative termination address, and determining a system stack area between the start address and the alternative termination address as a search area; determining a second stack address to be detected corresponding to the search area, and determining the second stack address to be detected as a search stop address under the condition that the second stack address to be detected meets a preset condition; determining a system stack area between the initial address and the second stack address to be detected as a new search area under the condition that the second stack address to be detected does not meet the preset condition and the stack data corresponding to the second stack address to be detected is the same as the initial data; determining a system stack area between a second stack address to be detected and an alternative termination address as a new search area under the condition that the second stack address to be detected does not meet the preset condition and stack data corresponding to the second stack address to be detected is different from initial data; determining a second stack address to be detected corresponding to the new search area, and determining the second stack address to be detected as a search stop address under the condition that the new second stack address to be detected meets a preset condition; and under the condition that the new second stack address to be detected does not meet the preset condition, repeatedly executing the operation until the search stop address is determined.
In some embodiments, a first stack address to be detected corresponding to a system stack is determined, and stack data corresponding to the first stack address to be detected is acquired; comparing stack data corresponding to the first stack address to be detected with the initial data to obtain a comparison result; under the condition that the comparison result is that stack data corresponding to the first stack address to be detected is different from the initial data, determining the first stack address to be detected as an alternative initial address, and determining a system stack area of the alternative initial address along the growth direction of a system stack as a search area; determining a second stack address to be detected corresponding to the search area, and determining the second stack address to be detected as a search stop address under the condition that the second stack address to be detected meets a preset condition; determining a system stack area between the alternative initial address and the second stack address to be detected as a new search area under the condition that the second stack address to be detected does not meet the preset condition and the stack data corresponding to the second stack address to be detected is the same as the initial data; determining a system stack area of the second stack address to be detected along the growth direction of the system stack as a new search area under the condition that the second stack address to be detected does not meet the preset condition and stack data corresponding to the second stack address to be detected is different from the initial data; determining a second stack address to be detected corresponding to the new search area, and determining the second stack address to be detected as a search stop address under the condition that the new second stack address to be detected meets a preset condition; and under the condition that the new second stack address to be detected does not meet the preset condition, repeatedly executing the operation until the search stop address is determined. As shown in fig. 4, fig. 4 is a schematic diagram of a lookup stop address determined from a system stack, and the arrow direction in fig. 4 represents the growth direction of the system stack.
Optionally, determining the usage rate of the system stack according to the number of stack data in the system stack, which is different from the initial data, includes: acquiring the number of filling groups of initial data; and calculating by using the number of stack data different from the initial data in the system stack and the number of filling groups according to a second preset algorithm to obtain the utilization rate of the system stack.
Optionally, obtaining the number of padding groups of the initial data includes: acquiring the size of a system stack and the size of initial data; and calculating by using the size of the system stack and the size of the initial data according to a first preset algorithm to obtain the filling group number of the initial data.
Optionally, the obtaining the number of padding groups of the initial data by performing calculation according to a first preset algorithm by using the size of the system stack and the size of the initial data includes: by calculation of
Figure BDA0003190139320000071
Obtaining the number of filling groups of initial data; wherein totalpatternumber is the number of padding groups of the initial data, theStackSize is the size of the system stack, thePattern Size is the size of the initial data.
Optionally, calculating by using the number of stack data and the number of padding groups in the system stack, which are different from the initial data, according to a second preset algorithm, to obtain the usage rate of the system stack, where the method includes: by calculating
Figure BDA0003190139320000081
Obtaining the utilization rate of a system stack; wherein, Z is the utilization rate of the system stack, W is the data group number of the initial data corresponding to the address where the search stops in the system stack, and TotalPatternNumber is the number of the padding groups of the initial data.
Optionally, calculating by using the utilization rate according to a third preset algorithm to obtain a remaining idle rate of the system stack, where the calculating includes: obtaining the remaining idle rate of the system stack by calculating FreeStackSizeInPercentage = 1-Z; wherein FreeStackSizeInPercentage is the remaining idle rate of the system stack, and Z is the utilization rate of the system stack.
Therefore, the system stack is filled by using the preset initial data, the initial data of the corresponding address can be rewritten into the stack data under the condition that the space of the system stack is used, the number of the stack data different from the initial data is determined by comparing the initial data of the same address with the stack data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data, and therefore the service condition of the system stack is obtained, and a user can take preventive measures conveniently.
Optionally, determining a search stop address in the system stack by a binary search, and stopping searching when a difference value between a data group number of a first group of initial data filled in a search area of the system stack and a data group number of a last group of initial data filled in the search area is a preset threshold value; determining an address corresponding to the initial data of the intermediate point in the search area as a search stop address; acquiring a data group number of initial data corresponding to the search stop address; determining the data group number as the number of stack data which is different from the initial data in a system stack; and determining the utilization rate of the system stack according to the number of stack data which is different from the initial data in the system stack.
Optionally, the preset threshold is 0 or 1.
Optionally, in a case that the system stack is an empty stack, a difference value between a data group number of the first set of initial data filled in the lookup area of the system stack and a data group number of the last set of initial data filled in the lookup area is 0.
Optionally, in a case that the system stack is full, a difference value between a data group number of the first set of initial data filled in the lookup area of the system stack and a data group number of the last set of initial data filled in the lookup area is 1.
Optionally, determining the usage rate of the system stack according to the number of stack data in the system stack, which is different from the initial data, includes: acquiring the number of filling groups of initial data; and calculating by using the number of stack data different from the initial data in the system stack and the number of filling groups according to a second preset algorithm to obtain the utilization rate of the system stack.
Optionally, obtaining the number of padding groups of the initial data includes: acquiring the size of a system stack and the size of initial data; and calculating by using the size of the system stack and the size of the initial data according to a first preset algorithm to obtain the filling group number of the initial data.
OptionallyCalculating by using the size of the system stack and the size of the initial data according to a first preset algorithm to obtain the number of the filling groups of the initial data, wherein the method comprises the following steps of: by calculating
Figure BDA0003190139320000091
Obtaining the number of filling groups of initial data; wherein, totalPatternNumber is the number of padding groups of the initial data, theStackSize is the size of the system stack, thePattern Size is the size of the initial data.
Optionally, calculating by using the number of stack data and the number of padding groups in the system stack, which are different from the initial data, according to a second preset algorithm, to obtain the usage rate of the system stack, where the method includes: by calculation of
Figure BDA0003190139320000092
Obtaining the utilization rate of a system stack; wherein, Z is the utilization rate of the system stack, W is the data group number of the initial data corresponding to the address where the search stops in the system stack, and TotalPatternNumber is the number of the padding groups of the initial data.
Optionally, calculating by using the usage rate according to a third preset algorithm to obtain a remaining idle rate of the system stack, including: obtaining the remaining idle rate of the system stack by calculating FreeStackSizeInPercentage = 1-Z; wherein FreeStackSizeInPercentage is the remaining idle rate of the system stack, and Z is the utilization rate of the system stack.
As shown in fig. 5, an apparatus for obtaining a system stack utilization rate according to an embodiment of the present disclosure includes: a filling module 501, an obtaining module 502 and a determining module 503; the filling module 501 is configured to fill the system stack with preset initial data; the obtaining module 502 is configured to obtain the number of stack data in the system stack that is different from the initial data, and send the number of stack data in the system stack that is different from the initial data to the determining module; the determining module 503 is configured to receive the number of stack data, which is different from the initial data, in the system stack sent by the obtaining module, and determine the usage rate of the system stack according to the number of stack data, which is different from the initial data, in the system stack.
By adopting the device for acquiring the utilization rate of the system stack, which is provided by the embodiment of the disclosure, the system stack is filled by the filling module by utilizing the preset initial data; acquiring the number of stack data different from the initial data in a system stack through an acquisition module; and determining the utilization rate of the system stack by the determining module according to the number of stack data which is different from the initial data in the system stack. The system stack is filled by utilizing the preset initial data, because the initial data of the corresponding address can be rewritten into the stack data under the used condition of the space of the system stack, the number of the stack data different from the initial data is determined by comparing the initial data of the same address with the stack data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data, and therefore the use condition of the system stack is obtained, and a user can take preventive measures conveniently.
Optionally, the obtaining module is configured to obtain the number of stack data in the system stack, which is different from the initial data, by: determining a first stack address to be detected corresponding to a system stack, and acquiring stack data corresponding to the first stack address to be detected; comparing stack data corresponding to the first stack address to be detected with the initial data to obtain a comparison result; determining a search area according to the comparison result; and determining the number of stack data different from the initial data in the system stack according to the search area.
Optionally, the obtaining module is configured to determine the search area according to the comparison result by: acquiring a starting address of a system stack, and determining the first stack address to be detected as an alternative terminating address under the condition that the comparison result is that stack data corresponding to the first stack address to be detected is the same as the initial data; and determining a system stack area between the starting address and the alternative terminating address as a search area.
Optionally, the obtaining module is configured to determine the search area according to the comparison result by: acquiring the growth direction of a system stack, and determining a first stack address to be detected as an alternative initial address under the condition that the comparison result shows that stack data corresponding to the first stack address to be detected is different from initial data; and determining a system stack area which starts from the alternative starting address and is in the same direction along the growing direction as the search area.
Optionally, the obtaining module is configured to determine the number of stack data in the system stack, which is different from the initial data, according to the search area by: acquiring the growth direction of a system stack, and determining a search stop address from a search area; the stack data corresponding to the search stop address is different from the initial data, and the previous group of stack data of the search stop address along the same direction as the growth direction is the same as the initial data; acquiring a data group number of initial data corresponding to the search stop address; the data group number is determined as the amount of stack data in the system stack that is not identical to the initial data.
Optionally, the determining module is configured to determine the usage rate of the system stack according to the number by: acquiring the number of filling groups of initial data; and calculating by using the number and the filling group number according to a second preset algorithm to obtain the utilization rate of the system stack.
As shown in fig. 6, an apparatus for obtaining system stack utilization according to an embodiment of the present disclosure includes a processor (processor) 600 and a memory (memory) 601 storing program instructions. Optionally, the device may also include a Communication Interface 602 and bus 603. The processor 600, the communication interface 602, and the memory 601 may communicate with each other via a bus 603. The communication interface 602 may be used for information transfer. Processor 600 may call program instructions in memory 601 to perform the method for acquiring system stack usage of the above-described embodiments.
By adopting the device for acquiring the utilization rate of the system stack, which is provided by the embodiment of the disclosure, the system stack is filled by utilizing preset initial data; acquiring the number of stack data different from the initial data in a system stack; and determining the utilization rate of the system stack according to the quantity. Because the system stack is filled by using the preset initial data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data by determining the number of the stack data different from the initial data, so that the service condition of the system stack is obtained, and a user can take preventive measures conveniently.
In addition, the program instructions in the memory 601 may be implemented in the form of software functional units and stored in a readable storage medium when the program instructions are sold or used as independent products.
The memory 601 is a storage medium and can be used for storing software programs, executable programs, such as program instructions/modules corresponding to the methods in the embodiments of the present disclosure. The processor 600 implements the method for acquiring the usage rate of the system stack in the above embodiment by executing the program instructions/modules stored in the memory 601 to execute functional applications and data processing.
The memory 601 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the terminal device, and the like. In addition, the memory 601 may include a high speed random access memory, and may also include a non-volatile memory.
By adopting the electronic equipment provided by the embodiment of the disclosure, the system stack is filled by utilizing preset initial data; acquiring the number of stack data different from the initial data in a system stack; and determining the utilization rate of the system stack according to the quantity. Because the system stack is filled by utilizing the preset initial data, the utilization rate of the system stack can be determined according to the number of the stack data different from the initial data and the total number of the initial data by determining the number of the stack data different from the initial data, so that the service condition of the system stack is obtained, and a user can take preventive measures conveniently.
Alternatively, the electronic device is a computer or a server, etc.
Embodiments of the present disclosure provide a storage medium storing executable instructions configured to perform the above method for obtaining system stack utilization.
The disclosed embodiments provide a computer program product comprising a computer program stored on a computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, cause the computer to perform the above-described method for obtaining system stack utilization.
The readable storage medium may be a transitory readable storage medium or a non-transitory readable storage medium.
The technical solution of the embodiments of the present disclosure may be embodied in the form of a software product, which is stored in a storage medium and includes one or more instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium comprising: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes, and may also be a transient storage medium.
The above description and drawings sufficiently illustrate embodiments of the disclosure to enable those skilled in the art to practice them. Other embodiments may incorporate structural, logical, electrical, process, and other changes. The examples merely typify possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in or substituted for those of others. Furthermore, the words used in the specification are words of description only and are not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, the terms "comprises" and/or "comprising," when used in this application, 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. Without further limitation, an element defined by the phrase "comprising a" \8230; "does not exclude the presence of additional like elements in a process, method or apparatus comprising the element. In this document, each embodiment may be described with emphasis on differences from other embodiments, and the same and similar parts between the respective embodiments may be referred to each other. For methods, products, etc. of the embodiment disclosures, reference may be made to the description of the method section for relevance if it corresponds to the method section of the embodiment disclosure.
Those of skill in the art would appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software may depend upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments. It can be clearly understood by the skilled person that, for convenience and brevity of description, the specific working processes of the system, the apparatus and the unit described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, apparatuses, etc.) may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units may be only one type of logical functional division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to implement the present embodiment. In addition, functional units in the embodiments of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than disclosed in the description, and sometimes there is no specific order between the different operations or steps. For example, two sequential operations or steps may in fact be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. Each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by special purpose hardware-based systems that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Claims (10)

1. A method for obtaining system stack utilization, comprising:
filling a system stack by using preset initial data;
acquiring the number of stack data different from the initial data in the system stack;
and determining the utilization rate of the system stack according to the number.
2. The method of claim 1, wherein obtaining the amount of stack data in the system stack that is not the same as the initial data comprises:
determining a first stack address to be detected corresponding to the system stack, and acquiring stack data corresponding to the first stack address to be detected;
comparing stack data corresponding to the first stack address to be detected with the initial data to obtain a comparison result;
determining a search area according to the comparison result;
and determining the number of stack data which is different from the initial data in the system stack according to the search area.
3. The method of claim 2, wherein determining a search area based on the comparison comprises:
determining the first stack address to be detected as an alternative termination address and acquiring a start address of the system stack under the condition that the comparison result is that stack data corresponding to the first stack address to be detected is the same as the initial data;
and determining a system stack area between the starting address and the alternative terminating address as a search area.
4. The method of claim 2, wherein determining a search area based on the comparison comprises:
determining the first stack address to be detected as an alternative starting address and acquiring the growth direction of the system stack under the condition that the comparison result is that the stack data corresponding to the first stack address to be detected is different from the initial data;
and determining a system stack area in the same direction along the growing direction from the alternative starting address as a search area.
5. The method of claim 4, wherein determining the amount of stack data in the system stack that is not the same as the initial data based on the lookup area comprises:
determining a search stop address from the search area; stack data corresponding to the search stopping address is different from the initial data, and a previous group of stack data of the search stopping address along the same direction as the growth direction is the same as the initial data;
acquiring a data group number of initial data corresponding to the search stop address;
and determining the data group number as the number of stack data which is different from the initial data in the system stack.
6. The method according to any of claims 1 to 5, wherein determining the usage of the system stack based on the number comprises:
acquiring the number of filling groups of the initial data;
and calculating by utilizing the number and the filling group number according to a second preset algorithm to obtain the utilization rate of the system stack.
7. An apparatus for deriving system stack utilization, comprising:
the filling module is configured to fill the system stack with preset initial data;
an obtaining module configured to obtain the number of stack data in the system stack that is different from the initial data;
a determining module configured to determine a usage rate of the system stack according to the number.
8. An apparatus for acquiring system stack usage, comprising a processor and a memory storing program instructions, wherein the processor is configured to perform the method of any of claims 1 to 6 when executing the program instructions.
9. An electronic device comprising means for deriving system stack usage according to claim 8.
10. A storage medium storing program instructions which, when executed, perform the method for deriving system stack usage of any of claims 1 to 6.
CN202110875512.2A 2021-07-30 2021-07-30 Method and device for acquiring system stack utilization rate, electronic equipment and storage medium Pending CN115686817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110875512.2A CN115686817A (en) 2021-07-30 2021-07-30 Method and device for acquiring system stack utilization rate, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110875512.2A CN115686817A (en) 2021-07-30 2021-07-30 Method and device for acquiring system stack utilization rate, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115686817A true CN115686817A (en) 2023-02-03

Family

ID=85059950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110875512.2A Pending CN115686817A (en) 2021-07-30 2021-07-30 Method and device for acquiring system stack utilization rate, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115686817A (en)

Similar Documents

Publication Publication Date Title
CN112363886B (en) Database monitoring method, system, terminal and storage medium
CN107590144A (en) A kind of file memory method and terminal
CN115378742B (en) Data processing method and device based on cloud computing
CN104932933A (en) Spin lock acquisition method and apparatus
CN110134646B (en) Knowledge platform service data storage and integration method and system
CN106933673B (en) Method and device for adjusting number of logical threads of component
CN103186585A (en) Queue processing method and device
CN109697281A (en) The online method, apparatus and electronic equipment for merging document
CN115686817A (en) Method and device for acquiring system stack utilization rate, electronic equipment and storage medium
CN109271538A (en) A kind of picture storage method and relevant device
US20170090820A1 (en) Method and device for operating a many-core system
CN114861614A (en) Method and device for filling data, electronic equipment and medium
CN104331406A (en) Database capacity control method and database capacity control device
CN111198986B (en) Information transmission method, device, electronic equipment and storage medium
CN112861005A (en) Method, device and equipment for information push
CN111158886A (en) Method and device for optimizing task scheduling of operating system and intelligent equipment
CN112464618A (en) Method and device for paging document data, storage medium and electronic equipment
CN115840836A (en) Method and device for storing data, electronic equipment and storage medium
CN113590187B (en) Method and device for acquiring codes and electronic equipment
CN111144509B (en) Method, device and computer for classifying system application programs
CN113194039B (en) Method and device for segmenting system data flow, electronic equipment and storage medium
CN112516593B (en) Card drawing method, card drawing system and computer equipment
CN115174594B (en) Data synchronization method, device, equipment and medium of distributed system
KR102484316B1 (en) Method and apparatus for configuring learning data set in object recognition
CN112540775A (en) Method, device and equipment for detecting compatibility of program package

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication