Unlock instant, AI-driven research and patent intelligence for your innovation.

A statistical method and system for stack space during operation

A statistical method and statistical system technology, applied in the field of information, can solve the problems that the compiler misses the call path, the maximum usage space is difficult to determine, and the maximum usage size of the stack space cannot be accurately counted.

Active Publication Date: 2019-06-28
星汉智能科技股份有限公司
View PDF6 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

It is difficult to determine the maximum space used by the stack
Although some compilers can obtain the stack space usage of each branch of the "function call tree" through grammatical analysis statistics, in C language, due to the possible use of function pointers, that is to say, the path of function calls is dynamically controlled by business logic. Yes, in this case the compiler may miss some call paths, resulting in the inability to accurately count the maximum usage of the stack space
Of course, we can also roughly estimate the maximum usage value of the stack space of a software system through experience, and then try to allocate a larger space to prevent overflow. However, resources such as embedded devices and single-chip microcomputers are very limited, and chip resources need to be used as much as possible. reduce waste of space

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • A statistical method and system for stack space during operation
  • A statistical method and system for stack space during operation
  • A statistical method and system for stack space during operation

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0021] The idea, specific structure and technical effects of the present invention will be clearly and completely described below in conjunction with the embodiments and accompanying drawings, so as to fully understand the purpose, scheme and effect of the present invention.

[0022] It should be noted that, unless otherwise specified, when a feature is called "fixed" or "connected" to another feature, it can be directly fixed and connected to another feature, or indirectly fixed and connected to another feature. on a feature. In addition, descriptions such as up, down, left, and right used in the present disclosure are only relative to the mutual positional relationship of the components of the present disclosure in the drawings. As used in this disclosure, the singular forms "a", "the", and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise. Also, unless defined otherwise, all technical and scientific terms used herein have...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The technical scheme of the invention comprises a statistical method and system for stack space during operation. The method includes: setting an address range and filling and searching characteristicvalues; generating an APDU command through the virtual module and sending the APDU command to the intelligent card for execution; and S300, enabling the smart card to search a specific value from thebottom of the stack to the top of the stack according to the content of the detection command, find out different data and corresponding addresses of the specific value filled in the step S300, and obtain the maximum modification space of the smart card and the use condition of the specific value. The method has the beneficial effects that the stack use condition in the running process of the intelligent card can be automatically, efficiently and accurately counted, and the use condition of a certain command can be counted to the minimum extent. Furthermore, the maximum stack space required by the operation of a certain function module in the card can be obtained, and the maximum stack space required by the operation of software on the intelligent card can be further obtained. The APDU command with the maximum stack space usage is found out from the statistical result, and a basis is provided for code optimization.

Description

technical field [0001] The invention relates to a method and a system for counting stack space during runtime, and belongs to the field of information technology. Background technique [0002] A smart chip such as a smart card is a secure hardware with arithmetic logic, storage area and communication interface, on which software runs to achieve specific functions, similar to a simplified version of a computer. The software running on the smart card is generally written and realized by assembly language, C language, JAVA language, etc. According to the complexity of the business logic, the software needs to be split into different modules. The most basic structure is composed of a series of computer language functions. The operation of the function generally requires a "runtime stack", which is used to save the information of the function execution and the return information of the function. [0003] Since the stack space stores data such as local variables, parameter passin...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/30
Inventor 王伟李庆福杨黄林
Owner 星汉智能科技股份有限公司