Isolation method, device and equipment for operation of multiple cards on same chip, medium and product
By combining and compiling the code of multiple cards on the same chip into one executable file, and synchronously launching each card in different threads, the problems of waste of resources and high costs in the existing technology are solved, and the operation environment and user data are isolated, ensuring security.
Patent Information
- Application Number
- CN202411971720.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-12-30
AI Technical Summary
In the prior art, the codes of the eSIM chip and the SE chip are compiled into executable files respectively, resulting in waste of resources and high costs, and the runtime needs to be isolated from each other to ensure security.
By combining the codes of multiple cards on the same chip into one executable file, and starting each card synchronously with different threads, detecting the target card when switching threads, reading and importing the target running environment, and completing the switching of the target card.
It reduces the storage resource usage of executable files on the chip, reduces resource consumption and cost, and synchronous isolation of the operating environment and user data through thread switching, meeting the data isolation requirements of different users and ensuring security.
Smart Images

Figure CN119759363A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the fields of security chips and telecommunications, and in particular to an isolation method, device, equipment, medium and product for multiple cards running on the same chip. Background Art
[0002] At present, security chips are widely used in mobile phones and other portable devices for some security services of mobile phones and other portable devices, such as data storage of transportation cards and bank cards, key storage and authentication of lock screen passwords. At the same time, mobile phones and some portable devices will also insert subscriber identification modules (SIM) cards or embed eSIM (Embedded-SIM) chips to realize telecommunications services.
[0003] Usually, the functions implemented by the eSIM chip and the secure element (SE) are highly repetitive, and many eSIM chip codes on the market are slightly modified from the SE chip codes. As the integration requirements of portable devices such as mobile phones increase, the eSIM chip and the SE chip are required to be merged into one chip to perform two services. At the same time, since the managers of the eSIM chip and the SE chip are different, their respective managers need to isolate the two services from each other for security reasons.
[0004] At present, in the related technology, the conventional practice is to compile two codes into compilable files and execute them independently, or to directly package the two chips into one to execute their respective services. The existing processing method has a large waste of resources and costs. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides an isolation method, device, equipment, medium and product for multiple cards running on the same chip.
[0006] In a first aspect, an embodiment of the present disclosure provides a method for isolating multiple cards running on the same chip, including:
[0007] Creating multiple threads with an executable file as an entry, wherein the executable file is obtained by merging and compiling codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads respectively;
[0008] In the case of monitoring that the current execution thread switches from the first thread to the second thread, determining a target card corresponding to the second thread;
[0009] Reading the target operating environment corresponding to the target card, and importing the target operating environment into the CPU resources;
[0010] Based on the target operating environment, the executable file is executed by the second thread to access the target user data of the target card, thereby completing the switching of the target card.
[0011] In a second aspect, an embodiment of the present disclosure provides an isolation device for running multiple cards on the same chip, including:
[0012] A thread creation module, used to create multiple threads using an executable file as an entry, wherein the executable file is obtained by merging and compiling codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads respectively;
[0013] A card acquisition module, configured to determine a target card corresponding to the second thread when monitoring that the current execution thread switches from the first thread to the second thread;
[0014] An environment reading module, used for reading a target operating environment corresponding to the target card, and importing the target operating environment into CPU resources;
[0015] The data access module is used to execute the executable file through the second thread based on the target operating environment to access the target user data of the target card and complete the switching of the target card.
[0016] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the executable instructions to implement the isolation method for multiple cards running on the same chip as described in the first aspect.
[0017] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to implement the isolation method for multiple cards running on the same chip as described in the first aspect.
[0018] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the computer program implements the isolation method for multiple cards running on the same chip as described in the first aspect.
[0019] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0020] The isolation scheme for multiple cards running on the same chip provided by the embodiment of the present disclosure creates multiple threads with an executable file as the entry, wherein the executable file is obtained by merging and compiling the codes of multiple cards on the same chip, and the multiple cards are started synchronously with different threads respectively; when the current execution thread is monitored to switch from the first thread to the second thread, the target card corresponding to the second thread is determined; the target operating environment corresponding to the target card is read, and the target operating environment is imported into the CPU resources; based on the target operating environment, the executable file is executed by the second thread to access the target user data of the target card, and the switching of the target card is completed. The scheme of the present disclosure is adopted, by merging and compiling the codes of multiple cards on the same chip into one executable file, and using one executable file to run the services corresponding to different cards, the occupation of the storage resources of the chip by the executable file is reduced, and the resource consumption and cost are reduced; and by starting each card with a different thread, the operating environment and user data are switched synchronously when the thread is switched, forming the operation isolation of different cards under one executable file, meeting the isolation requirements of different users for data, and ensuring security. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0022] Figure 1 A schematic diagram showing the separate compilation of codes for an SE card and an eSIM card running on the same chip in the prior art;
[0023] Figure 2 A flowchart of a method for isolating multiple cards running on the same chip provided by an exemplary embodiment of the present disclosure;
[0024] Figure 3 A schematic diagram showing code merging and compiling of an SE card and an eSIM card running on the same chip according to an exemplary embodiment of the present disclosure is shown;
[0025] FIG4( a ) shows a schematic diagram of the process when the eSIM card is executed;
[0026] FIG4( b ) shows a schematic diagram of the process when the SE card is executed;
[0027] Figure 5 A schematic diagram showing a security chip integrating an SE card and an eSIM card according to an exemplary embodiment of the present disclosure is shown;
[0028] Figure 6 A schematic diagram of the structure of an isolation device for operating multiple cards on the same chip provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0030] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0031] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0032] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0033] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0034] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0035] At present, in order to ensure that different cards are isolated from each other when running, the existing technology is to compile the codes of different cards into executable files and execute them independently, such as Figure 1 As shown, the code of the eSIM card (C file) and the code of the SE card are respectively input into the compiler for compilation to obtain their respective executable files (HEX files). Since there are some repeated codes in the code of the eSIM card and the code of the SE card, there are also repeated contents in the compiled executable files, resulting in a waste of storage resources, high resource consumption and cost.
[0036] In view of the above problems, the present disclosure provides an isolation method for multiple cards running on the same chip, wherein the chip running multiple cards can be a security chip, using the security chip as a carrier, and running the security chip's services and telecommunication services on the security chip at the same time, and can also expand the security chip to run services of other chips as needed. This solution uses a single executable file to run different services of multiple cards, and realizes runtime isolation of security chip services and telecommunication services through isolated storage and use of user data and operating environment.
[0037] The following is a detailed explanation of the isolation method, device, equipment, medium and product for multiple cards running on the same chip provided by the present disclosure in conjunction with the accompanying drawings.
[0038] Figure 2 A flow chart of a method for isolating multiple cards running on the same chip provided for an exemplary embodiment of the present disclosure. The method can be executed by an isolation device for isolating multiple cards running on the same chip provided for an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can be integrated in an electronic device, specifically, can be integrated in an operating system of the electronic device.
[0039] like Figure 2 As shown, the isolation method for multiple cards running on the same chip may include the following steps:
[0040] Step 101, creating multiple threads with an executable file as an entry, wherein the executable file is obtained by merging and compiling codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads.
[0041] The same chip is a chip, and multiple cards on the same chip means that multiple cards are integrated on one chip to implement services corresponding to different cards. For example, a security chip can be used as a carrier, and all cards for services to be implemented can be integrated on the security chip to implement multiple cards on one chip.
[0042] The codes of cards (chips) that implement different services may contain some repeated code content. If they are compiled separately, there will also be some repeated content in the compiled executable files, resulting in unnecessary use of storage resources. In this embodiment, in order to reduce the consumption of storage resources by repeated codes, the codes corresponding to multiple cards on the same chip are merged and compiled to obtain an executable file. The executable file is an executable object actually generated by the code and can be executed by the operating system. Different operating systems have different naming methods for executable files, such as the executable file of Windows is exe. The same executable file can execute several threads simultaneously. Whether there will be resource conflicts depends on the logic during execution and the resources accessed.
[0043] Among them, merging and compiling multiple codes into an executable file can be achieved in different ways.
[0044] As an optional implementation, codes corresponding to multiple cards on the same chip can be obtained, and the codes corresponding to the multiple cards can be merged to obtain a merged code, and then the merged code can be compiled to obtain an executable file. It can be understood that when the codes corresponding to the multiple cards are merged to obtain the merged code, only one copy of the duplicated code in the obtained codes of the multiple cards is retained, and the same parts in other codes are deleted, thereby reducing the total size of the code.
[0045] As an optional implementation, the codes corresponding to multiple cards on the same chip can be obtained, and the target code corresponding to any one of the multiple cards can be compiled to obtain a main project file; and the codes of other cards except the any one of the multiple cards can be compared with the target code, and the code content of the other cards that is different from the target code can be obtained, and the code content of the other cards can be compiled to obtain module files, and then an executable file can be generated based on the main project file and the module file. In this implementation, the code of one of the multiple cards is compiled as a main project to obtain a main project file, and the main project file is executable. The codes of the other cards except the card need to be compared with the target code as the main project to determine the non-repeated parts in the code, and are compiled as modules to obtain module files. The module files depend on the main project file for execution, and access and call each other when executed in the software environment.
[0046] The above-mentioned method of merging and compiling multiple codes to obtain an executable file only compiles the repeated parts in different codes once, without compiling the repeated codes multiple times, thus reducing the resource consumption of the executable file. Figure 3 As shown in the figure, taking the running of SE card and eSIM card on the same chip as an example, there is 100K of duplicate code between the eSIM card code and the SE card code, and the total code size of the two codes is 800K. By merging the two codes into a combined code, the code size of the combined code is 700K. The combined code is input into the compiler for compilation to obtain the SE&eSIM executable file, and the size of the executable file is 700K. Figure 3 and Figure 1 By comparison, it can be seen that the executable file obtained by the combined compilation (size is 700K) reduces the storage resource usage by 100K compared to the two executable files obtained by compiling each code separately (total size is 800K).
[0047] In this embodiment, for the obtained executable file, the executable file can be used as an entry to create multiple threads, wherein the number of created threads is consistent with the number of multiple cards integrated on the chip, and multiple cards are synchronously started with different threads, and one card uniquely corresponds to one thread. Each card on the chip uses the same executable file and starts multiple different threads to complete their respective services. Since there is only one central processing unit (CPU) resource of the chip, only one thread can be executed at the same time. Executing different threads through different time slices forms a phenomenon of multiple threads being executed in parallel. After a certain thread is executed for a certain period of time, it needs to switch to another thread for execution.
[0048] Step 102: When it is detected that the current execution thread switches from the first thread to the second thread, a target card corresponding to the second thread is determined.
[0049] The first thread is a thread currently in execution among the multiple threads, and the second thread is a thread to which the first thread needs to be switched after executing for a certain period of time.
[0050] In this embodiment, when the operating system of the electronic device detects that the current execution thread switches from the first thread to the second thread, the card corresponding to the second thread (referred to as the target card for ease of description and distinction) can be determined. Since threads and cards correspond one to one, when the second thread is known, the target card started on the thread can be uniquely determined.
[0051] Step 103, read the target operating environment corresponding to the target card, and import the target operating environment into the CPU resources.
[0052] In this embodiment, after the target card is determined, the operating environment corresponding to the target card (referred to as the target operating environment for ease of description and distinction) can be read and imported into the CPU resources, thereby implementing the switching of the corresponding operating environment when the thread is switched.
[0053] As an example, the operating environment of each card in the multiple cards is stored in a different random access memory (RAM) address, so that all the operating environments required for the operation of each card on the chip are stored in different physical areas, respectively, to realize the extraction of the operating environments of different cards, wherein the operating environments include but are not limited to global variables and registers. Thus, when reading the target operating environment corresponding to the target card, the target RAM address corresponding to the target card can be determined according to the mapping relationship between different cards and RAM addresses, and then the target operating environment corresponding to the target card can be read from the target RAM address.
[0054] In an optional implementation of the present disclosure, before importing the target operating environment into the CPU resources, the operating environment of the card started on the first thread mounted in the CPU resources can be saved to its corresponding RAM address, and then the target operating environment can be imported into the CPU resources, so that only one operating environment required for the operation of the card is mounted in the CPU resources, so that only one thread is executed at the same time.
[0055] For example, assuming that the current execution thread is the thread where the SE card is located, when switching from the thread where the SE card is located to the thread where the eSIM card is located, all the operating environments in the CPU resources are those of the SE card. When the thread switching is triggered, the operating system will save the current SE card operating environment to the RAM address corresponding to the SE card, and at the same time, take out the eSIM card operating environment from the RAM address corresponding to the eSIM card and import it into the CPU resources to realize the switching of the operating environment.
[0056] Step 104: Based on the target operating environment, the second thread executes the executable file to access the target user data of the target card, thereby completing the switching of the target card.
[0057] In this embodiment, after the target operating environment is imported into the CPU resources, all operating environments in the CPU resources are switched to those of the target card. At this time, the operating system executes the executable file through the second thread based on the target operating environment, accesses the user data of the target card (referred to as target user data for ease of description and distinction), completes the switching of the target card, and the target card can operate normally.
[0058] It is understandable that, since the operating environments corresponding to different cards are different, even if different threads execute the same executable file and access the same address, the user data read out is different, thereby realizing the extraction of user data of different cards.
[0059] Taking the running of SE card and eSIM card on the same chip as an example, FIG4(a) shows a schematic diagram of the process when the eSIM card is executed, and FIG4(b) shows a schematic diagram of the process when the SE card is executed. As shown in FIG4(a) and FIG4(b), the execution environment and user data of the eSIM card and the SE card are stored in different physical areas respectively. When the eSIM card is executed, the switching module reads the eSIM operating environment from the physical area corresponding to the eSIM card and imports it into the CPU resources, and reads the eSIM user data and imports it into the user data address. The thread of the eSIM card executes the executable file. When the code execution position reaches the pointer position for accessing the user data, the eSIM user data is read from the user data address to ensure the normal operation of the eSIM card. When the SE card is executed, the switching module reads the SE operating environment from the physical area corresponding to the SE card and imports it into the CPU resources, and reads the SE user data and imports it into the user data address. The thread of the SE card executes the executable file. When the code execution position reaches the pointer position for accessing the user data, the SE user data is read from the user data address to ensure the normal operation of the SE card. The switching module may be implemented by software or hardware, and the switching module may be compiled into the operating system or loaded into the operating system and started, and the module takes effect each time a thread is switched.
[0060] The isolation method for multiple cards running on the same chip provided by the embodiment of the present disclosure creates multiple threads with an executable file as the entry, wherein the executable file is obtained by merging and compiling the codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads respectively; when the current execution thread is monitored to switch from the first thread to the second thread, the target card corresponding to the second thread is determined; the target operating environment corresponding to the target card is read, and the target operating environment is imported into the CPU resources; based on the target operating environment, the executable file is executed by the second thread to access the target user data of the target card, and the switching of the target card is completed. The scheme of the present disclosure is adopted, by merging and compiling the codes of multiple cards on the same chip into one executable file, and using one executable file to run the services corresponding to different cards, the occupation of the storage resources of the chip by the executable file is reduced, and the resource consumption and cost are reduced; and by starting each card with a different thread, the operating environment and user data are synchronously switched when the thread is switched, forming the operation isolation of different cards under one executable file, meeting the isolation requirements of different users for data, and ensuring security.
[0061] In an optional implementation of the present disclosure, the target operating environment includes a target memory mapping table, which records the mapping relationship between the target virtual address and the physical address storing the user data of the target card. Thus, in this embodiment, based on the target operating environment, when the executable file is executed by the second thread to access the target user data of the target card, the executable file is executed by the second thread, and when the executable file is executed by the second thread to the pointer position to access the user data, the target virtual address is read, and then the target memory mapping table is queried to determine the target physical address corresponding to the target virtual address, and then the target user data of the target card is accessed from the target physical address.
[0062] Further, in an optional embodiment of the present disclosure, the user data corresponding to the multiple cards on the same chip are stored in different physical addresses, and different cards correspond to different memory mapping tables to map the target virtual address to different physical addresses. That is to say, in this embodiment, among the multiple cards running on the chip, the user data corresponding to each card is stored in different physical addresses, the user data of one card is stored in at least one physical address, and these physical addresses are different from the physical addresses storing the user data of other cards. Each card corresponds to its own operating environment, and the operating environment includes a memory mapping table corresponding to the card, and the memory mapping table records the mapping relationship between the target virtual address and all physical addresses storing the user data of the card, that is, the same target virtual address corresponds to different physical addresses in different memory mapping tables, and the user data of different cards can be accessed. Therefore, when the threads of different cards execute the same executable file to access the same target virtual address, the memory mapping tables are different, and the physical addresses accessed are also different, so as to read the user data of the corresponding card. By storing the user data of different cards in different physical addresses, the isolation of the user data of different cards is achieved.
[0063] Figure 5 A schematic diagram of a security chip integrating an SE card and an eSIM card according to an exemplary embodiment of the present disclosure is shown. Figure 5As shown, the operating environment of the SE card and the eSIM card is stored in the RAM storage area, and the user data of the SE card and the eSIM card is stored in the Flash storage area. When the thread switches, for example, from the thread of the SE card to the thread of the eSIM card, the eSIM operating environment is read from the RAM storage area and imported into the CPU resources, and the SE operating environment in the CPU resources is saved in the RAM. When the executable file executes to the pointer position for accessing user data, the user data address storage address (that is, the target virtual address mentioned above) is accessed. By accessing the memory mapping table, the physical address where the eSIM user data is stored can be determined, and then the eSIM user data can be accessed through the physical address. It can be understood that the specific logic executed by the same executable file is determined by the program pointer in the CPU resources. In addition, it should be noted that the logic and address of the same executable file are exactly the same when accessing user data. The user data of different cards that are isolated from each other can be accessed because the reading of user data is realized by mapping the target virtual address of the memory mapping table to the physical address where the user data is stored. That is, when accessing a fixed target virtual address, it will be relocated to another address by software or hardware (memory mapping table), and the relocated address is the real address where the user data is stored. Through the solution disclosed in this disclosure, the operation isolation of eSIM and SE services is realized.
[0064] In order to implement the above embodiment, the present disclosure also provides an isolation device for operating multiple cards on the same chip.
[0065] Figure 6 This is a schematic diagram of the structure of an isolation device for running multiple cards on the same chip provided by an embodiment of the present disclosure. The device is implemented in software and / or hardware and can be integrated in an electronic device.
[0066] like Figure 6 As shown, the isolation device 20 for running multiple cards on the same chip may include: a thread creation module 210 , a card acquisition module 220 , an environment reading module 230 and a data access module 240 .
[0067] The thread creation module 210 is used to create multiple threads using an executable file as an entry, wherein the executable file is obtained by merging and compiling the codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads respectively;
[0068] The card acquisition module 220 is used to determine the target card corresponding to the second thread when monitoring that the current execution thread switches from the first thread to the second thread;
[0069] The environment reading module 230 is used to read the target operating environment corresponding to the target card and import the target operating environment into the CPU resources;
[0070] The data access module 240 is used to execute the executable file through the second thread based on the target operating environment to access the target user data of the target card and complete the switching of the target card.
[0071] Optionally, the executable file is compiled as follows:
[0072] Get the codes corresponding to multiple cards on the same chip;
[0073] Merge the codes corresponding to the multiple cards to obtain a merged code;
[0074] Compile the merged code to get an executable file.
[0075] Optionally, the executable file is compiled as follows:
[0076] Get the codes corresponding to multiple cards on the same chip;
[0077] Compile the target code corresponding to any one of the multiple cards to obtain a main project file;
[0078] Compare the codes of other cards except any one card among the multiple cards with the target code, and obtain the code contents of the other cards which are different from the contents of the target code;
[0079] Compile the code contents of other cards separately to obtain module files;
[0080] Generate executable files based on the main project files and module files.
[0081] Optionally, the operating environment of each card in the multiple cards is stored in a different random access memory RAM address; the environment reading module 230 is further used to:
[0082] According to the mapping relationship between different cards and RAM addresses, determine the target RAM address corresponding to the target card;
[0083] Read the target operating environment corresponding to the target card from the target RAM address.
[0084] Optionally, the target operating environment includes a target memory mapping table, and the data access module 240 is further used to:
[0085] When the executable file is executed by the second thread to the pointer position for accessing the user data, the target virtual address is read;
[0086] Querying a target memory mapping table to determine a target physical address corresponding to a target virtual address;
[0087] Access the target user data of the target card from the target physical address.
[0088] Further optionally, the user data corresponding to the multiple cards on the same chip are respectively stored in different physical addresses;
[0089] Different cards correspond to different memory mapping tables to map the target virtual address to different physical addresses.
[0090] The isolation device for multiple cards running on the same chip of an electronic device provided in the embodiment of the present disclosure can execute the isolation method for multiple cards running on the same chip provided in the embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. For the contents not described in detail in the embodiment of the device of the present disclosure, reference can be made to the description in any method embodiment of the present disclosure.
[0091] The embodiments of the present disclosure also provide a computer program product, including a computer program / instruction, which, when executed by a processor, implements the isolation method for multiple cards running on the same chip provided by any embodiment of the present disclosure.
[0092] According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device, including:
[0093] processor;
[0094] a memory for storing instructions executable by the processor;
[0095] The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the isolation method for multiple cards running on the same chip as provided in any embodiment of the present disclosure.
[0096] According to one or more embodiments of the present disclosure, the present disclosure provides a computer-readable storage medium, wherein the storage medium stores a computer program, wherein the computer program is used to implement the isolation method for multiple cards running on the same chip as provided in any embodiment of the present disclosure.
[0097] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0098] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0099] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0100] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0101] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0102] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0103] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0104] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0105] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for isolating multiple cards running on the same chip, characterized in that: The method comprises: Creating multiple threads with an executable file as an entry, wherein the executable file is obtained by merging and compiling codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads respectively; In the case of monitoring that the current execution thread switches from the first thread to the second thread, determining a target card corresponding to the second thread; Reading the target operating environment corresponding to the target card, and importing the target operating environment into the CPU resources; Based on the target operating environment, the second thread executes the executable file to access the target user data of the target card, thereby completing the switching of the target card.
2. The method according to claim 1, characterized in that: The executable file is compiled in the following way: Obtaining codes respectively corresponding to the multiple cards on the same chip; Merging the codes corresponding to the multiple cards to obtain a merged code; The merged code is compiled to obtain the executable file.
3. The method according to claim 1, characterized in that The executable file is compiled in the following way: Obtaining codes respectively corresponding to the multiple cards on the same chip; Compiling the target code corresponding to any one of the multiple cards to obtain a main project file; Compare the codes of other cards among the multiple cards except the any one card with the target code to obtain part of the code content of the other cards that is different from the content of the target code; Compiling the code contents of the other cards respectively to obtain module files; The executable file is generated based on the main project file and the module file.
4. The method according to claim 1, characterized in that: The operating environment of each card in the plurality of cards is stored in a different random access memory RAM address; The reading of the target operating environment corresponding to the target card includes: Determine the target RAM address corresponding to the target card according to the mapping relationship between different cards and RAM addresses; The target operating environment corresponding to the target card is read from the target RAM address.
5. The method according to claim 1, characterized in that: The target operating environment includes a target memory mapping table, and executing the executable file through the second thread based on the target operating environment to access target user data of the target card includes: When the executable file is executed by the second thread to the pointer position for accessing user data, reading the target virtual address; Querying the target memory mapping table to determine a target physical address corresponding to the target virtual address; The target user data of the target card is accessed from the target physical address.
6. The method according to claim 5, characterized in that The user data corresponding to the multiple cards on the same chip are respectively stored in different physical addresses; Different cards correspond to different memory mapping tables to map the target virtual address to different physical addresses.
7. An isolation device for multiple cards running on the same chip, characterized in that: The device comprises: A thread creation module, used to create multiple threads using an executable file as an entry, wherein the executable file is obtained by merging and compiling codes of multiple cards on the same chip, and the multiple cards are synchronously started with different threads respectively; A card acquisition module, configured to determine a target card corresponding to the second thread when monitoring that the current execution thread switches from the first thread to the second thread; An environment reading module, used for reading a target operating environment corresponding to the target card, and importing the target operating environment into CPU resources; The data access module is used to execute the executable file through the second thread based on the target operating environment to access the target user data of the target card and complete the switching of the target card.
8. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the isolation method for multiple cards running on the same chip as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program is used to implement the isolation method for multiple cards running on the same chip as described in any one of claims 1 to 6.
10. A computer program product, characterized in that It includes a computer program, wherein when the computer program is executed by a processor, it implements the isolation method for multiple cards running on the same chip as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Card processing
CN102439562A
Network isolation password board card
CN110166240A
SE-based code program protection method and device and storage medium
CN113268717A
Method for dynamically using cryptographic keys in a postage meter
US20020065782A1