Binary system simulation system and method based on container technology

Through the binary simulation system based on container technology, the problems of large startup and operation overhead and low resource utilization in the existing technology are solved, fast response and efficient resource utilization are achieved, maintenance costs are reduced, and the continuity of simulation tasks is ensured. stability.

CN119292733APending Publication Date: 2025-01-10NANJING XINCHUANHUI ELECTRONIC TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411304602.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-19
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing binary simulation technology has problems such as high startup and operation overhead and low resource utilization. Virtual machine management is complex and maintenance costs are high, hardware simulation equipment is expensive and update and maintenance costs are high, which limits its application scope.

Method used

Using a binary simulation system based on container technology, by installing a container engine on the host, creating a container environment, packaging binary code and dependency files into container images, dynamically adjusting CPU and memory quotas, using optimization algorithms to improve simulation efficiency, and through hot Update mechanism replaces code, monitors performance indicators and logs in real time, and sets alarm rules.

Benefits of technology

It significantly improves the system response speed and resource utilization rate, reduces the start time of simulation tasks, avoids resource waste, ensures the continuity and stability of simulation tasks, and reduces the downtime caused by maintenance and updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292733A_ABST
    Figure CN119292733A_ABST
Patent Text Reader

Abstract

The invention discloses a binary simulation system and method based on a container technology, and belongs to the technical field of binary simulation. The method comprises the following steps: installing and deploying a container engine on a host machine, and creating a container environment for simulation; packaging the binary code to be simulated and the operation dependency file into a container mirror image, and deploying the container mirror image into a pre-created container; starting a simulation task; dynamically adjusting the CPU and memory quota of the container according to the requirement of the simulation task in the simulation operation; according to the method, the simulation analysis efficiency is improved through an optimization algorithm, in the method, a container shares an operating system kernel of a host machine and only contains necessary applications and library files, the starting time is short and can be generally completed within the second level, and the response speed of the system is greatly improved; and the container does not need to simulate the whole operating system environment like a virtual machine, so that the resource overhead is smaller, more simulation tasks can be operated under the same hardware resource, and the overall resource utilization rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of binary simulation technology, and in particular to a binary simulation system and method based on container technology. Background Art

[0002] Binary emulation refers to the process of simulating another computer system to run a binary program on one computer system. It is widely used in software development, testing, security analysis and other fields.

[0003] At present, binary emulation is mainly achieved through the following technical means:

[0004] 1. Binary emulation based on virtualization technology:

[0005] Traditional binary emulation systems usually rely on virtualization technologies, such as VMware, VirtualBox, etc. These virtualization platforms simulate a complete operating system environment by running a virtual machine on the host machine, so that binary code can run in the virtual machine.

[0006] For example, patent document US20100229143A1 describes a binary code simulation method based on a virtual machine, which uses a virtual machine monitor (Hypervisor) to manage and schedule the resources of the virtual machine to achieve the simulation of the binary code. However, this method has the problems of large startup and operation overhead and low resource utilization. Specifically, the startup time of the virtual machine is long, which occupies a large amount of CPU and memory resources, affecting the simulation efficiency. In addition, the management and maintenance of the virtual machine are complicated, which increases the operation and maintenance cost of the system.

[0007] 2. Binary emulation based on hardware emulation:

[0008] Hardware emulation technology uses specific hardware devices, such as FPGA (Field-Programmable Gate Array) or dedicated simulators, to simulate the execution of binary code.

[0009] The paper “A High-Performance FPGA-Based Binary Translation System”, published in IEEE Transactions on Computers, Vol. 58, No. 6, 2009, describes a high-performance binary translation system based on FPGA, which realizes fast simulation of binary code through hardware accelerator.

[0010] Although hardware simulation has high simulation accuracy and speed, the hardware equipment is expensive, and the configuration and use are complicated, which is not suitable for rapid deployment and large-scale application. In addition, the update and maintenance costs of hardware simulation equipment are high, which limits its application scope. Summary of the invention

[0011] In order to solve the problems in the prior art, the present invention provides a binary simulation system and method based on container technology.

[0012] On the one hand, a binary simulation method based on container technology is provided, the method comprising:

[0013] S1: Install and deploy the container engine on the host machine to create a container environment for simulation;

[0014] S2: Package the binary code to be simulated and the running dependency files into a container image and deploy it to the pre-created container;

[0015] S3: Start the simulation task;

[0016] S4: Dynamically adjust the CPU and memory quotas of the container according to the needs of the simulation task during the simulation operation;

[0017] S5: Improve simulation analysis efficiency by optimizing algorithms.

[0018] Furthermore, the method further comprises:

[0019] S6: monitors the performance indicators of the container in real time and records the running log of the simulation task in real time;

[0020] S7: Set alarm rules to issue an alarm when the performance indicator exceeds the preset threshold.

[0021] Furthermore, the performance indicators include: CPU usage, memory usage, and network traffic of the container;

[0022] The operation log includes: the execution process of the binary code, performance data, and error information.

[0023] Furthermore, the S5 specifically includes:

[0024] Collect runtime performance data during simulation runs;

[0025] Analyze the hot spots and performance bottlenecks of the code according to the performance data;

[0026] Optimize hotspot areas through optimization algorithms;

[0027] The optimized code directly replaces the running code through the hot update mechanism.

[0028] Furthermore, the performance data includes: code execution time, CPU usage, and memory usage.

[0029] Furthermore, the optimization algorithm includes a dynamic analysis algorithm and a resource scheduling algorithm.

[0030] Furthermore, the container engine is Docker or Kubernetes.

[0031] On the other hand, a binary simulation system based on container technology is provided, the system comprising:

[0032] The container engine creation module is used to install and deploy the container engine on the host machine and create a container environment for simulation;

[0033] The code deployment module is used to package the binary code to be simulated and the running dependency files into a container image and deploy it to a pre-created container;

[0034] Resource allocation module, used to dynamically adjust the CPU and memory quotas of containers according to the needs of simulation tasks during simulation operation;

[0035] The execution efficiency optimization module is used to improve the simulation analysis efficiency by optimizing the algorithm during simulation operation.

[0036] Furthermore, the system further comprises:

[0037] Monitoring module, used to monitor the performance indicators of containers in real time;

[0038] The logging module is used to record the running log of the simulation task in real time;

[0039] The alarm module is used to issue an alarm when the performance index exceeds the preset threshold.

[0040] The beneficial effects of the technical solution provided by the embodiment of the present invention are as follows: first, in the present invention, a container engine is installed on the host machine to create a container environment for simulation; the binary code to be simulated and the running dependency files are packaged into a container image and deployed to a pre-created container. The container shares the operating system kernel of the host machine and only contains necessary applications and library files. The startup time is short and can usually be completed within seconds, which greatly improves the response speed of the system, especially in scenarios where simulation tasks need to be started and stopped frequently. Moreover, since the container does not need to simulate the entire operating system environment like a virtual machine, its resource overhead is smaller. Under the same hardware resources, more simulation tasks can be run, thereby improving overall resource utilization.

[0041] Secondly, during the simulation run, the CPU and memory quotas of the container are dynamically adjusted according to the needs of the simulation task to ensure that the simulation task can run efficiently under different loads. This not only improves the execution efficiency of the simulation task, but also effectively avoids resource waste, ensuring that the system can flexibly respond to different workloads while making efficient use of resources.

[0042] In addition, during the simulation operation, the simulation analysis efficiency is improved by optimizing the algorithm. The optimized code can directly replace the running code through the hot update mechanism without stopping the simulation task. This hot update mechanism ensures the continuity and stability of the simulation task, while greatly shortening the optimization application cycle. This not only improves the efficiency of the simulation, but also reduces the downtime caused by system maintenance and updates. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 It is a flow chart of container creation provided by the present invention;

[0045] Figure 2 This is a schematic diagram of dynamically adjusting the CPU and memory quota of a container engine provided by the present invention;

[0046] Figure 3 It is a performance optimization flow chart provided by the present invention;

[0047] Figure 4 It is an example diagram of a simulation task execution provided by the present invention;

[0048] Figure 5 It is a schematic diagram of resource scheduling optimization provided by the present invention;

[0049] Figure 6 This is an architecture diagram of a binary simulation system based on container technology provided by the present invention. DETAILED DESCRIPTION

[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0051] To make the objectives, technical solutions and advantages of the present invention more clear, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0052] Embodiment 1

[0053] A binary simulation method based on container technology includes the following steps:

[0054] Step (1): Prepare the host environment.

[0055] It should be noted that, first of all, you need to choose a host machine with good performance. The hardware configuration of the host machine directly affects the performance and stability of the simulation system. Therefore, you need to ensure that it has enough CPU cores, high-frequency processors, large-capacity memory and fast storage devices.

[0056] Next, install the container engine on the host machine, which can be Docker or Kubernetes. Docker is an open source platform that allows developers to easily package, distribute and run applications. The installation process includes updating the host's operating system software package, downloading the Docker engine and installing and configuring it. Kubernetes is an open source container orchestration engine from Google that supports automated deployment, large-scale scalability, and application container management. When deploying an application in a production environment, multiple instances of the application are usually deployed to load balance application requests.

[0057] Step (2): Creation of container.

[0058] It should be noted that a new container instance is created using the Docker command. The container is a lightweight virtualization technology. Each container runs independently and can provide an independent operating environment, allowing applications to run in an isolated space. When creating a container, you can specify the operating system image to be used, such as Ubuntu, to provide the operating system environment required for the simulation task. Once the container is created, it can be configured to ensure that it has the necessary operating environment and dependency packages to successfully execute binary simulation tasks.

[0059] Step (3): Package the binary code to be simulated and the running dependency files into a container image and deploy it to the pre-created container.

[0060] It should be noted that the binary code to be simulated and its dependent files are packaged into a directory. This directory contains all the files required to perform the simulation task, such as binary executable files, configuration files, and data files. Use Docker's copy command to copy the packaged binary code directory to the specified location in the container, so that the container has all the resources required to run the simulation task. Enter the container and run the binary code to start the simulation task. You can execute the startup script or directly run the binary file through the container's command line interface to start the simulation task.

[0061] It is worth mentioning that the creation of container drivers is fast and takes up less resources; container technology is lighter than traditional virtualization technology (such as virtual machines); containers share the host's operating system kernel and only contain necessary applications and library files, with a short startup time that can usually be completed within seconds, which greatly improves the system's response speed, especially in scenarios where simulation tasks need to be started and stopped frequently.

[0062] Since containers do not need to simulate the entire operating system environment like virtual machines, their resource overhead is smaller. With the same hardware resources, more simulation tasks can be run, improving overall resource utilization.

[0063] Step (4): During the simulation run, dynamically adjust the CPU and memory quota of the container according to the requirements of the simulation task.

[0064] It should be noted that through the Docker API interface, the resource usage of the container is monitored in real time, and the resource allocation of the container is dynamically adjusted as needed, including adjusting the CPU and memory quota of the container to ensure that the simulation task can run efficiently under different loads. The system will regularly check the resource usage of the container. When it detects that the CPU or memory usage of the container is high, the system will automatically increase the resource quota of the container; when it detects that the resource usage is low, the system will reduce resource allocation, thereby improving overall resource utilization. This dynamic adjustment mechanism not only improves the execution efficiency of the simulation task, but also effectively avoids resource waste, ensuring that the system can flexibly respond to different workloads while making efficient use of resources.

[0065] Combined with the scheduling mechanism of container orchestration tools (such as Kubernetes), it is possible to intelligently schedule container instances according to the load and resource usage of the simulation tasks to ensure efficient operation. This scheduling mechanism can prioritize the resource requirements of critical tasks when resources are tight, thereby improving the overall efficiency of the system.

[0066] Step (5): Improve the efficiency of simulation analysis by optimizing the algorithm.

[0067] It should be noted that during the binary code execution process, the system will collect runtime performance data, including: code execution time, CPU usage, memory usage. The system analyzes the hot spots and performance bottlenecks of the code based on the collected performance data. Hot spots refer to code parts with long execution time or high resource consumption. These areas are usually the focus of optimization.

[0068] Optimize hot spots. Optimization measures may include rewriting performance bottleneck codes, using more efficient data structures and optimization algorithms, including dynamic analysis algorithms and resource scheduling algorithms, reducing unnecessary calculations and memory accesses, and even using parallelization technology and hardware acceleration to improve execution efficiency.

[0069] The optimized code can directly replace the running code through the hot update mechanism without stopping the simulation task. This hot update mechanism ensures the continuity and stability of the simulation task, while greatly shortening the optimization application cycle, which not only improves the efficiency of the simulation, but also reduces the downtime caused by system maintenance and updates.

[0070] Step (6): Logging and monitoring alarms.

[0071] It should be noted that by deploying monitoring tools (such as Prometheus and Grafana), the performance indicators of the simulation system can be monitored in real time, including CPU usage, memory usage, network traffic, etc. These performance data can help operation and maintenance personnel to promptly discover and solve performance bottlenecks and ensure the stable operation of the system; record the operation log of the simulation task, including the execution process of the binary code, performance data, error information, etc., to facilitate subsequent analysis and debugging; set alarm rules, and when the performance indicators of the simulation system exceed the preset threshold, trigger the alarm to notify the operation and maintenance personnel to handle it in time. This mechanism can greatly reduce the impact time of system failures and improve the reliability of the system.

[0072] It is worth noting that the present invention can be applied to: 1. Software development and testing: It can accelerate the software development and testing process, especially in a development environment that requires frequent iteration and verification.

[0073] 2. Security Analysis and Reverse Engineering: Through efficient binary emulation, this method can be used for malware analysis and reverse engineering, helping security researchers to understand and analyze the behavior of binary codes more quickly.

[0074] 3. Education and scientific research: This method can be used in computer science education and scientific research. Through simulation experiments and performance analysis, it can help students and researchers deeply understand the operating mechanism of computer systems.

[0075] Take a specific application scenario as an example. For example, a computer security company needs to dynamically analyze a large number of binary malware samples to discover potential security threats. The company uses the binary simulation method based on container technology of the present invention to perform simulation analysis. By installing the Docker container engine on the host machine, multiple container instances are created. Each container instance is used to run a simulation task of a malware sample. During the simulation process, the system monitors the resource usage of the container in real time and dynamically adjusts resource allocation according to the load of the task. At the same time, the system collects performance data through dynamic analysis, identifies the hot code of the malware sample, and optimizes it to improve the efficiency of the simulation analysis. In this way, the company can quickly and efficiently analyze a large number of malware samples, and promptly discover and respond to potential security threats.

[0076] Embodiment 2

[0077] A binary simulation system based on container technology can implement a binary simulation method based on container technology in embodiment one.

[0078] The system includes: a container engine creation module, which is used to install and deploy the container engine on the host machine to create a container environment for simulation; a code deployment module, which is used to package the binary code to be simulated and the running dependency files into a container image, and deploy it to a pre-created container; a resource allocation module, which is used to dynamically adjust the CPU and memory quota of the container according to the needs of the simulation task during the simulation operation; an execution efficiency optimization module, which is used to improve the simulation analysis efficiency by optimizing the algorithm during the simulation operation; a monitoring module, which is used to monitor the performance indicators of the container in real time; a log recording module, which is used to record the running log of the simulation task in real time; and an alarm module, which is used to alarm when the performance indicator exceeds the preset threshold.

[0079] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0080] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A binary simulation method based on container technology, characterized in that: The method comprises: S1: Install and deploy the container engine on the host machine to create a container environment for simulation; S2: Package the binary code to be simulated and the running dependency files into a container image and deploy it to the pre-created container; S3: Start the simulation task; S4: Dynamically adjust the CPU and memory quotas of the container according to the needs of the simulation task during the simulation operation; S5: Improve simulation analysis efficiency by optimizing algorithms.

2. The binary simulation method based on container technology according to claim 1 is characterized in that: The method further comprises: S6: monitors the performance indicators of the container in real time and records the running log of the simulation task in real time; S7: Set alarm rules to issue an alarm when the performance indicator exceeds the preset threshold.

3. The binary simulation method based on container technology according to claim 2 is characterized in that: The performance indicators include: CPU usage, memory usage, and network traffic of the container; The operation log includes: the execution process of the binary code, performance data, and error information.

4. The binary simulation method based on container technology according to claim 1 is characterized in that: The S5 specifically includes: Collect runtime performance data during simulation runs; Analyze the hot spots and performance bottlenecks of the code according to the performance data; Optimize hotspot areas through optimization algorithms; The optimized code directly replaces the running code through the hot update mechanism.

5. The binary simulation method based on container technology according to claim 4 is characterized in that: The performance data includes: code execution time, CPU usage, and memory usage.

6. The binary simulation method based on container technology according to claim 4 is characterized in that: The optimization algorithm includes a dynamic analysis algorithm and a resource scheduling algorithm.

7. The binary simulation method based on container technology according to claim 1 is characterized in that: The container engine is Docker or Kubernetes.

8. A binary simulation system based on container technology, characterized in that: The system comprises: The container engine creation module is used to install and deploy the container engine on the host machine and create a container environment for simulation; The code deployment module is used to package the binary code to be simulated and the running dependency files into a container image and deploy it to a pre-created container; Resource allocation module, used to dynamically adjust the CPU and memory quotas of containers according to the needs of simulation tasks during simulation operation; The execution efficiency optimization module is used to improve the simulation analysis efficiency by optimizing the algorithm during simulation operation.

9. The binary emulation system based on container technology according to claim 8, characterized in that: The system further comprises: Monitoring module, used to monitor the performance indicators of containers in real time; The logging module is used to record the running log of the simulation task in real time; The alarm module is used to issue an alarm when the performance index exceeds the preset threshold.

Citation Information

Patent Citations

  • Detection and removal of hazards during optimization of logic circuits

    US20100229143A1