Data identification method, identification service container, computer device and storage medium

By adding a virtual machine running a second operating system and a network file system to the authentication service container, the problem of the authentication tool module being unable to run on non-compatible operating systems was solved, enabling cross-operating system data authentication and improving applicability and efficiency.

CN115600198BActive Publication Date: 2026-11-20QI AN XIN TECHNOLOGY GROUP INC +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110769356.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-07
Publication Date
2026-11-20
Estimated Expiration
2041-07-07

AI Technical Summary

Technical Problem

Existing identification tool modules cannot function properly on incompatible operating systems, resulting in limited applicability.

Method used

A virtual machine running a second operating system is added to the authentication service container running the first operating system. An authentication service module and an authentication tool module are set up in the virtual machine. Cross-operating system data access and result storage are achieved through the network file system.

Benefits of technology

The identification tool module was able to run normally on non-compatible operating systems, which improved its applicability, simplified the data access and result storage process, and improved the efficiency of data identification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115600198B_ABST
    Figure CN115600198B_ABST
Patent Text Reader

Abstract

The application relates to a data identification method, an identification service container, a computer device and a storage medium. The method is applied to an identification service container running a first operating system, the identification service container comprising a virtual machine running a second operating system, and the virtual machine comprising an identification service module and an identification tool module. The method comprises the following steps: the identification service module determines a storage path corresponding to to-be-identified data in response to an identification request; the identification tool module acquires the to-be-identified data according to the storage path; and the identification tool module identifies the to-be-identified data to obtain an identification result. Thus, the method achieves the purpose of normally running the identification tool module in a non-adapted operating system, and improves the applicability of the identification tool module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data authentication technology, and in particular to a data authentication method, authentication service container, computer equipment, and storage medium. Background Technology

[0002] An identification platform is a general-purpose platform that uses identification tool modules (such as antivirus software and data analysis tools) to extract specific information from the data to be identified. However, the operation of these identification tool modules is operating system-dependent. For example, an identification tool module adapted to Windows can only perform identification functions within the Windows operating system environment and cannot run on other types of operating systems (such as Linux). Therefore, the applicability of existing identification tool modules is relatively low.

[0003] To improve the applicability of the identification tool module, how to make the identification tool module run normally on non-compatible operating systems has become a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0004] Therefore, it is necessary to provide a data authentication method, authentication service container, computer equipment, and storage medium to address the aforementioned technical problems.

[0005] A data authentication method is applied to an authentication service container running a first operating system, the authentication service container including a virtual machine running a second operating system, the virtual machine including an authentication service module and an authentication tool module; the method includes:

[0006] The identification service module responds to the identification request and determines the storage path corresponding to the data to be identified.

[0007] The identification tool module obtains the data to be identified according to the storage path;

[0008] The identification tool module identifies the data to be identified and obtains the identification result.

[0009] In one embodiment, the method further includes:

[0010] The identification service module generates an identification start command containing the storage path and sends the identification start command to the identification tool module;

[0011] The identification tool module obtains the data to be identified according to the storage path, including:

[0012] The identification tool module parses the identification start command to obtain the storage path, and retrieves the data to be identified based on the storage path.

[0013] In one embodiment, the authentication service container also includes a network file system;

[0014] In response to the authentication request, the authentication service module determines the storage path corresponding to the data to be authenticated, including:

[0015] The authentication service module parses the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated being stored in the external storage.

[0016] The authentication service module maps the external storage path to an internal mount path in the network file system.

[0017] The identification tool module obtains the data to be identified according to the storage path, including:

[0018] The identification tool module obtains the data to be identified through the network file system according to the internal mount path.

[0019] In one embodiment, the method further includes:

[0020] The identification service module parses the identification results to obtain the analysis results;

[0021] The authentication service module stores the parsing result to the external storage via the network file system according to the internal mount path corresponding to the parsing result;

[0022] The authentication service module maps the internal mounting path corresponding to the parsing result to the external storage path corresponding to the parsing result, and returns the external storage path corresponding to the parsing result to the authentication request container.

[0023] In one embodiment, the authentication service module, in response to an authentication request, determines the storage path corresponding to the data to be authenticated, including:

[0024] The authentication service module receives authentication requests sent by the authentication request container via remote procedure call through the remote procedure call interface on the authentication service container;

[0025] The authentication service module determines the storage path corresponding to the data to be authenticated based on the authentication request.

[0026] In one embodiment, before the authentication service module responds to the authentication request, it further includes:

[0027] Create a virtual machine network corresponding to the virtual machine in the authentication service container;

[0028] Start the virtual machine in the virtual machine network;

[0029] The identification service module acquires the identification service program, and the identification tool module acquires the identification tool program, so as to realize the identification function by running the identification service program and the identification tool program.

[0030] In one embodiment, the method further includes:

[0031] In response to detecting that the virtual machine image associated with the virtual machine is corrupted or that the virtual machine image occupies a space threshold in external storage, it is detected whether the virtual machine image carries a rollback mark;

[0032] If the virtual machine image carries a rollback flag, then the virtual machine image is rolled back according to the snapshot corresponding to the virtual machine image, so that the virtual machine is restored to the state where the identification tool module is successfully activated, and the rollback flag is cleared. The snapshot is created after the identification tool module is successfully activated.

[0033] An authentication service container runs a first operating system. The container includes a virtual machine running a second operating system. The virtual machine includes an authentication service module and an authentication tool module.

[0034] The identification service module is used to determine the storage path corresponding to the data to be identified in response to the identification request.

[0035] The identification tool module is used to obtain the data to be identified according to the storage path;

[0036] The identification tool module is also used to identify the data to be identified and obtain the identification result.

[0037] An authentication service system includes an authentication request container and an authentication service container. The authentication service container runs a first operating system and includes a virtual machine running a second operating system. The virtual machine includes an authentication service module and an authentication tool module, wherein:

[0038] The authentication request container is used to send authentication requests to the authentication service module;

[0039] The authentication service module is used to determine the storage path corresponding to the data to be authenticated in response to the authentication request.

[0040] The identification tool module is used to obtain the data to be identified according to the storage path;

[0041] The identification tool module is also used to identify the data to be identified and obtain the identification result.

[0042] A computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program performing the following steps:

[0043] The authentication service module responds to the authentication request sent by the authentication request container and determines the storage path corresponding to the data to be authenticated.

[0044] The identification tool module obtains the data to be identified according to the storage path;

[0045] The identification tool module identifies the data to be identified and obtains the identification result.

[0046] A computer-readable storage medium having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0047] The authentication service module responds to the authentication request sent by the authentication request container and determines the storage path corresponding to the data to be authenticated.

[0048] The identification tool module obtains the data to be identified according to the storage path;

[0049] The identification tool module identifies the data to be identified and obtains the identification result.

[0050] The aforementioned data authentication method, authentication service container, computer equipment, and storage medium, by adding a virtual machine running a second operating system to the authentication service container running a first operating system, and setting up an authentication service module and an authentication tool module within the virtual machine, allow the authentication service module adapted to the second operating system, running within the authentication service container running the first operating system, to respond to authentication requests sent by the authentication request container and determine the storage path corresponding to the data to be authenticated. Similarly, the authentication tool module adapted to the second operating system, running within the authentication service container running the first operating system, can retrieve the data to be authenticated based on the storage path, authenticate the data, and obtain the authentication result. Thus, this application achieves the goal of enabling the authentication tool module to run normally on non-adapted operating systems, improving the applicability of the authentication tool module. Attached Figure Description

[0051] Figure 1 This is a diagram illustrating the application environment of a data identification method in one embodiment;

[0052] Figure 2 This is a flowchart illustrating a data identification method in one embodiment;

[0053] Figure 3 This is a timing diagram of a data identification method in one embodiment;

[0054] Figure 4 This is a timing diagram of the startup of the authentication service container in one embodiment;

[0055] Figure 5 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] The data identification method provided in this application can be applied to, for example... Figure 1 In the application environment shown, the authentication request container 10 is connected to the authentication service container 12, and both are connected to external storage 14. External storage 14 stores the data to be authenticated. The authentication service container 12 runs a first operating system and includes a virtual machine 122 running a second operating system. The virtual machine 122 includes an authentication service module 1222 and an authentication tool module 1224. Specifically, in response to the authentication request sent by the authentication request container 10, the authentication service module 1222 determines the storage path corresponding to the data to be authenticated; the authentication tool module 1224 retrieves the data to be authenticated according to the storage path; and the authentication tool module 1224 authenticates the data to be authenticated to obtain the authentication result.

[0058] In one embodiment, such as Figure 2 As shown, a data authentication method is provided, which is applied to... Figure 1 Taking the authentication service container in the example, the following steps are included:

[0059] In step S202, the identification service module responds to the identification request and determines the storage path corresponding to the data to be identified.

[0060] The authentication request can be generated by an authentication request container. An authentication request container is a container used to generate requests for data authentication. An authentication service container is a container used to implement the data authentication function. Optionally, the container type can be a Docker container. The authentication request carries the storage path corresponding to the data to be authenticated. External storage is a storage device set up independently of the authentication server, relative to the authentication service container. External storage can be a physical machine. Optionally, the data in external storage can be shared, for example, by creating a shared directory.

[0061] Specifically, based on their authentication needs, users input data to be authenticated on the terminal. The terminal sends this data to the authentication request container. The authentication request container stores the data in external storage. Optionally, a shared directory for the authentication request container and the authentication service container is pre-built in the external storage. The authentication request container stores the data to be authenticated in this shared directory so that the authentication service container can subsequently read the data through this shared directory. Then, the authentication request container generates an authentication request containing the storage path corresponding to the data to be authenticated and sends it to the authentication service module in the authentication service container. Optionally, the authentication request container sends the authentication request to the authentication service module in the authentication service container via Remote Procedure Call (GRPC). The authentication service module receives the authentication request sent by the authentication request container.

[0062] Optionally, the authentication service module receives the authentication request sent by the authentication request container via remote procedure call through the remote procedure call interface on the authentication service container, and determines the storage path corresponding to the data to be authenticated based on the authentication request.

[0063] Step S204: The identification tool module retrieves the data to be identified according to the storage path.

[0064] Specifically, the identification tool module retrieves the data to be identified from external storage according to the storage path. Optionally, the identification tool module retrieves the data to be identified from external storage via a Network File System (NFS) protocol according to the storage path.

[0065] Step S206: The identification tool module identifies the data to be identified and obtains the identification results.

[0066] Specifically, the identification tool module identifies the data to be identified and obtains the identification results.

[0067] In the aforementioned data authentication method, a virtual machine running a second operating system is added to the authentication service container running the first operating system. An authentication service module and an authentication tool module are then configured within the virtual machine. Thus, the authentication service module adapted to the second operating system, running within the authentication service container running the first operating system, can respond to authentication requests sent by the authentication request container and determine the storage path corresponding to the data to be authenticated. The authentication tool module adapted to the second operating system, running within the authentication service container running the first operating system, can retrieve the data to be authenticated based on the storage path, authenticate the data, and obtain the authentication result. Therefore, this application achieves the goal of enabling the authentication tool module to run normally on non-adapted operating systems, improving the applicability of the authentication tool module.

[0068] In one embodiment, the method further includes the following steps:

[0069] In step S212, the identification service module generates an identification start command containing the storage path and sends the identification start command to the identification tool module.

[0070] The identification start command is used to instruct the identification tool module to enable the identification function.

[0071] Furthermore, step S204 can be implemented through the following steps:

[0072] In step S204a, the identification tool module parses the identification start command to obtain the storage path and retrieves the data to be identified based on the storage path.

[0073] In this embodiment, an identification start command is generated based on the storage path to instruct the identification tool module to start the identification function and obtain the data to be identified for subsequent identification operations, thereby ensuring the normal execution of the identification function.

[0074] like Figure 3 As shown, in one embodiment, the authentication service container also includes a Network File System (NFS). Based on this, in one embodiment, step S202 can be implemented through the following steps:

[0075] Step S2022: The authentication service module parses the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated being stored in the external storage.

[0076] Step S2024: Map the external storage path to an internal mount path in the network file system.

[0077] Specifically, in this embodiment, the network file system can be mounted over the network, enabling the authentication service container to access files on external storage on the network as if they were files within the authentication service container itself. First, the network file system within the authentication service container is allowed to be mounted to a shared directory on external storage. Correspondingly, the external storage path is the path of the storage space on the external storage, and the internal mount path is the path through which the authentication service module retrieves data from the external storage via the network file system. Therefore, a mapping relationship is pre-established between the internal mount path and the corresponding external storage path, allowing the authentication service module to map the external storage path to an internal mount path in the network file system based on the external storage path and this mapping relationship.

[0078] Furthermore, after step S2024, the method further includes the following steps:

[0079] In step S222, the authentication service module generates an authentication start command containing the internal mount path and sends the authentication start command to the authentication tool module.

[0080] In step S2042, the identification tool module parses the identification startup command to obtain the internal mount path, and obtains the data to be identified through the network file system based on the internal mount path.

[0081] Specifically, the identification tool module parses the identification startup command, enables the identification function and obtains the internal mount path, and then retrieves the data to be identified from the external storage through the network file system according to the internal mount path.

[0082] In this embodiment, by employing a network file system, the authentication service module in the authentication service container can access the data to be authenticated in external storage as if it were local data. Compared to the traditional method of first downloading the data to be authenticated sent by the authentication request container to the virtual machine's disk, then starting the authentication tool module, and finally deleting the downloaded data to be authenticated after analysis, this embodiment saves the step of downloading the data to be authenticated to the virtual machine's disk and is simpler to operate.

[0083] In one embodiment, the method further includes the following steps:

[0084] Step S222: The identification service module parses the identification results to obtain the analysis results;

[0085] Step S224: The authentication service module stores the parsing result to the external storage via the network file system according to the internal mount path corresponding to the parsing result.

[0086] In step S226, the authentication service module maps the internal mounting path corresponding to the parsing result to the external storage path corresponding to the parsing result, and returns the external storage path corresponding to the parsing result to the authentication request container.

[0087] Specifically, the authentication service module collects the authentication results output by the authentication tool module, parses the results to obtain the parsed results, and then stores the parsed results in external storage via the network file system according to the internal mount path corresponding to the parsed results. Finally, the authentication service module maps the internal mount path corresponding to the parsed results to the external storage path corresponding to the parsed results. Optionally, the authentication service module returns the external storage path corresponding to the parsed results to the authentication request container via Remote Procedure Call (GRPC).

[0088] In this embodiment, by using a network file system, the authentication service module in the authentication service container can directly save the parsing results in the network file system. Compared with the traditional technology of first saving the parsing results in the virtual machine's disk and then transferring the parsing results in the virtual machine's disk to the authentication service container, this saves the step of saving the parsing results in the virtual machine's disk, which is beneficial to improving the efficiency of data authentication.

[0089] like Figure 4 As shown, in one embodiment, before step S202 "the authentication service module receives the authentication request sent by the authentication request container", the method further includes the following steps:

[0090] Step S232: Create a virtual machine network corresponding to the virtual machine in the authentication service container;

[0091] Step S234: Start the virtual machine in the virtual machine network;

[0092] Step S236: The identification service module obtains the identification service program, and the identification tool module obtains the identification tool program, so as to realize the identification function by running the identification service program and the identification tool program.

[0093] Specifically, within the authentication service container, the execution process is as follows, involving the execution of the container startup script:

[0094] First, execute the script command `virsh net-define network.xml` to create a virtual machine network. The `network.xml` file defines a NAT type network named `default`, with a network address range of 192.168.122.0 / 24, a gateway of `virbr0`, and an IP address of 192.168.122.1.

[0095] The script example is as follows

[0096]

[0097]

[0098] Execute the script command `virsh net-start default` to start the virtual machine network named `default` that you created.

[0099] Then, execute the script command `virt-install --name vm1 --ram 2048 --vcpus=2 --os-variant=win7 --virt-type=kvm --hvm --network=bridge=virbr0 --disk vm1_path.qcow2` to create and start a virtual machine with 2048MB of memory, 2 CPUs, a Windows 7 operating system, a virtual machine network named "default" (gateway "virbr0"), and `vm1_path.qcow2` as the virtual machine disk. The virtual machine name is defined as `vm1`.

[0100] Next, considering that the Secure Shell (SSH) service is installed in the virtual machine, the scp tool (scp uses Secure Shell to transfer data) was used to copy the authentication service program and authentication tool program to the virtual machine, specifically:

[0101] The script command `scp -r license / code / tools / kamala@vm1:~ / ` is used to copy the `code` directory containing the authentication service program and the `tools` directory containing the authentication tools program to the `~ / ` directory on the virtual machine `vm1`. Here, `kamala` is the login account used to log in to the virtual machine using Secure Shell.

[0102] Within the virtual machine, the authentication service module and the authentication tool module acquire the authentication service program and the authentication tool program, respectively, to perform the authentication function by running these programs. Specifically:

[0103] Log in to the virtual machine vm1 using Secure Shell and start the authentication function.

[0104] The script command `ssh kamala@vm1'python code / main.py'` is executed. The identification service program and identification tool program are written in the Python programming language, and the identification function path is `code / main.py`.

[0105] If the authentication function code / main.py exits abnormally, or if the Secure Shell network fails, or if the virtual machine restarts abnormally, the script command will be executed repeatedly to ensure the availability of the authentication function.

[0106] In this embodiment, by creating a virtual machine network in the authentication service container and sending the authentication service program and authentication tool program to the authentication service module and authentication tool module, the normal implementation of the data authentication function is ensured.

[0107] In one embodiment, after step S234 "Start the virtual machine in the virtual machine network", the method further includes the following steps:

[0108] Step S242: The identification tool module obtains the tool activation program and runs the tool activation program to activate the tool;

[0109] Step S244: After the identification tool module is successfully activated, shut down the virtual machine;

[0110] Step S246: Create a snapshot of the virtual machine;

[0111] Step S248: Restart the virtual machine.

[0112] Specifically, different activation methods are used for different identification tool modules. Specific activation scripts (register.py) can be pre-written for each identification tool module that needs activation. The activation process can be done by logging into the virtual machine (vm1) via Secure Shell and executing the activation script (code / register.py). The script commands are as follows:

[0113] The command `ssh kamala@vm1'python code / register.py license / '` directs users to the `code / register.py` directory, where `code / register.py` is the activation script and the `license / ` directory contains the necessary license files for activating the authentication tool module.

[0114] The code / register.py file uses the program's exit status code to indicate the activation status: 0 for successful activation and 1 for failed activation.

[0115] Then, after the identification tool module is successfully activated, shut down the virtual machine, specifically as follows:

[0116] Execute the script command `virsh stop vm1` to shut down virtual machine vm1.

[0117] Next, create a virtual machine snapshot and restart the virtual machine, specifically as follows:

[0118] Execute the script command `virsh start vm1` to start the virtual machine.

[0119] In one embodiment, the method further includes the following steps:

[0120] Step S252: In response to detecting that the virtual machine image associated with the virtual machine is corrupted or that the virtual machine image occupies a space threshold in the external storage, detect whether the virtual machine image carries a rollback mark.

[0121] Step S254: If the virtual machine image carries a rollback marker, then roll back the virtual machine image according to the snapshot corresponding to the virtual machine image so that the virtual machine is restored to the state where the identification tool module is successfully activated, and clear the rollback marker.

[0122] The snapshot is created after the identification tool module is successfully activated.

[0123] Specifically, when a corrupted virtual machine image is detected (e.g., the server hosting the identification service container experiences a power outage or abnormal restart) or when the virtual machine image's space usage in external storage reaches a certain threshold, the system checks if the virtual machine image carries a rollback marker (e.g., a revert marker). If the virtual machine image carries a rollback marker, it performs a rollback operation on the virtual machine image based on the corresponding snapshot. After the rollback is complete, the virtual machine is restored to the state it was in when the snapshot was created, i.e., the state after the identification tool module in the virtual machine was successfully activated for the first time. Then, the virtual machine is restarted, and the rollback marker is cleared.

[0124] More specifically, execute the following script commands in sequence:

[0125] The command `test -f revert_path` determines whether a virtual machine image carries the `revert` tag. Here, `revert_path` is the file path to the `revert` tag.

[0126] `qemu-img snapshot-a snapshot1 vm1_path.qcow2` rolls back the virtual machine image. `snapshot1` is the name of the snapshot corresponding to the virtual machine image `vm1_path.qcow2`.

[0127] rm revert_path completes the rollback and clears the revert flag.

[0128] In this embodiment, when the image is damaged or occupies too much storage space, the virtual machine image is rolled back to restore the virtual machine to the state after the identification tool module was initially activated. This eliminates the need to reactivate the identification tool module, saving the cost of using the identification tool module, avoiding the usage restrictions of the identification tool module, and enabling the periodic cleaning of the space occupied by the virtual machine image.

[0129] In one embodiment, the process of creating a snapshot corresponding to a virtual machine image includes the following steps:

[0130] After the identification tool module is successfully activated, a snapshot named snapshot1 is created on the virtual machine image vm1_path.qcow2, specifically as follows:

[0131] Execute the script commands sequentially:

[0132] `virsh shutdown vm1` shuts down the virtual machine. `vm1` is the name of the virtual machine.

[0133] The command `qemu-img snapshot -c snapshot1 vm1_path.qcow2` creates a snapshot of a virtual machine image. Here, `snapshot1` is the name of the snapshot, and `vm1_path.qcow2` is the virtual machine image.

[0134] The snapshot creation is complete after running `virsh start vm1`. Restart the virtual machine. Here, `vm1` is the virtual machine name.

[0135] In one embodiment, the process of creating a virtual machine image includes the following steps:

[0136] After the virtual machine network is successfully created, if the virtual machine image is detected to be missing, the script command `qemu-img create-b template_vm.qcow2 -f qcow2 vm1_path.qcow2` is executed to create a new virtual machine image `vm1_path.qcow2` from the virtual machine image template `template_vm.qcow2`.

[0137] The following describes an embodiment of this application using a specific application scenario:

[0138] It should be noted that the identification platform is a general-purpose platform that uses identification tools (modules) to extract specific information from samples (the files to be analyzed by the identification tools, i.e., the data to be identified). Identification tools can be, for example, antivirus software or sample analysis tools. The identification platform adopts a Docker container-based architecture and uses Kubernetes for cluster resource management. Identification tools are available for both Linux and Windows platforms. Linux platform identification tools are directly integrated into the containers, while Windows platform identification tools require Windows to run. Each Docker container is called a Scanner, responsible for calling the identification tools and parsing the identification output. Each Scanner runs an identification service that exposes a gRPC interface. gRPC is a Remote Procedure Call (RPC) protocol developed by Google, with its transport layer based on HTTP / 2 and serialization based on Google's Proto Buffers.

[0139] In this embodiment, the first operating system is a Linux operating system, and the second operating system is a Windows operating system. Based on this, this embodiment designs an architecture in which a Windows virtual machine runs inside a container using libvirt (libvirt is a toolkit for managing virtualization platforms that supports virtualization technologies such as KVM, QEMU, and Xen), and the identification tool runs inside the Windows virtual machine, in order to achieve the goal of running Windows-like identification tools on a Linux server cluster.

[0140] To implement the solution of running a Windows virtual machine in a container, the Windows virtual machine and its authentication service module need to be started and provide services externally when each container starts. Therefore, this data authentication method includes a container startup process, which specifically includes:

[0141] Step S302: Create virtual machine network; Step S304: Roll back virtual machine image; Step S306: Start virtual machine; Step S308: Transfer activation and authentication service program and authentication tool program to virtual machine; Step S310: Start authentication service in virtual machine.

[0142] If the identification tool needs to be activated, the steps between steps S308 and S310 include: step S312, activating the identification tool; step S314, shutting down the virtual machine; step S316, creating a virtual machine snapshot; and step S318, restarting the virtual machine.

[0143] Furthermore, in one embodiment, considering that some identification tools require activation before use, and tool manufacturers typically limit the number of activations, and that server power outages or abnormal restarts during container operation can lead to image corruption of running virtual machines, requiring the re-creation of the virtual machine image and reactivation of the identification tool, and considering that virtual machine images are stored in shared storage—external storage—the storage space occupied by virtual machine images increases with virtual machine runtime, necessitating periodic cleanup of image-occupied space to conserve shared storage, an image management process is designed. This process creates an image snapshot of the virtual machine after activation by the identification tool. If the image is corrupted or occupies excessive storage space, the virtual machine image is rolled back, restoring the virtual machine to its initial state after tool activation. This eliminates the need for tool reactivation, saving on tool usage costs and circumventing tool manufacturer restrictions.

[0144] Therefore, this data authentication method also includes a mirror management process, which specifically includes:

[0145] Step S322: Create a snapshot. Specifically, after the identification tool is successfully activated (this could be in step S312 of the container startup process where the identification tool activation returns a status code of 0), a snapshot of the virtual machine image is created. Step S324: Roll back the image. Specifically, when the container starts, if a revert flag is detected (this revert flag is an empty file indicating whether an image rollback operation is needed; it can be manually set), the snapshot created in step S322 is used to perform the image rollback operation. After the rollback is complete, the virtual machine is restored to the state when the snapshot was created in step S322, i.e., the state after the identification tool in the virtual machine was initially successfully activated. Restart the Windows virtual machine and clear the revert flag.

[0146] Furthermore, in one embodiment, the data authentication method further includes an authentication service process, which specifically includes:

[0147] In step S332, the authentication request container on the calling side stores the sample in a directory on the same physical machine as the authentication service container, and the authentication service container reads the sample from this shared directory. Furthermore, the authentication service container stores the authentication results in this shared directory, and the authentication request container reads the authentication results from this shared directory. By using a shared directory, one file copy operation between the authentication request container and the authentication service container (Scanner) can be saved.

[0148] Step S334: The authentication request container initiates an authentication request via GRPC, and the request includes the external storage path.

[0149] Step S336: After receiving the GRPC request, the authentication service module on the Windows virtual machine converts the external storage path into an internal mount path on the virtual machine (e.g., an NFS mount path, where NFS stands for Network File System), then starts the authentication tool and passes the converted NFS path to the authentication tool.

[0150] Step S338: The identification tool analyzes the sample byte stream and outputs the identification results. Traditionally, the sample from the identification request container must first be downloaded to a virtual machine, then the identification tool must be started for analysis, and finally the downloaded sample must be deleted after analysis. This step, however, uses NFS, saving one operation of "saving the sample to the virtual machine disk." This virtual machine disk is the virtual machine image mentioned earlier.

[0151] In step S310, the authentication service module on the Windows virtual machine collects and parses the output of the authentication tool, and then saves the parsing results on NFS. In this step, saving the parsing results directly on NFS saves one step compared to first saving the parsing results to the virtual machine disk and then transferring the parsing results from the virtual machine disk to the authentication service container.

[0152] In step S312, the authentication service module on the Windows virtual machine returns the NFS path where the parsing results are saved to the authentication request container via GRPC.

[0153] It should be understood that, although Figure 2 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 2 At least some of the steps in the process may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least some of the steps or stages in other steps.

[0154] In one embodiment, an authentication service container is provided. The authentication service container runs a first operating system and includes a virtual machine running a second operating system. The virtual machine includes an authentication service module and an authentication tool module.

[0155] The authentication service module is used to determine the storage path of the data to be authenticated in response to an authentication request.

[0156] The identification tool module is used to retrieve the data to be identified based on the storage path.

[0157] The identification tool module is also used to identify the data to be identified and obtain the identification results.

[0158] In the aforementioned authentication service container, by adding a virtual machine running a second operating system within the authentication service container running the first operating system, and setting up an authentication service module and an authentication tool module within the virtual machine, the authentication service module adapted to the second operating system, running within the authentication service container running the first operating system, can respond to authentication requests sent by the authentication request container, determine the storage path corresponding to the data to be authenticated, and the authentication tool module adapted to the second operating system, running within the authentication service container running the first operating system, can retrieve the data to be authenticated according to the storage path, authenticate the data to be authenticated, and obtain the authentication result. Thus, this application achieves the goal of enabling the authentication tool module to run normally on non-adapted operating systems, improving the applicability of the authentication tool module.

[0159] In one embodiment, the authentication service module is further configured to generate an authentication start command containing a storage path and send the authentication start command to the authentication tool module;

[0160] The identification tool module is specifically used to parse the identification startup command to obtain the storage path and retrieve the data to be identified based on the storage path.

[0161] In one embodiment, the authentication service container also includes a network file system;

[0162] The authentication service module is specifically used to parse the authentication request sent by the authentication request container, obtain the external storage path corresponding to the data to be authenticated stored in the external storage, and map the external storage path to the internal mount path in the network file system.

[0163] The identification tool module is specifically used to obtain the data to be identified through the network file system based on the internal mount path.

[0164] In one embodiment, the authentication service module is further configured to parse the authentication result, obtain the parsing result, store the parsing result in an external storage memory according to the external storage path corresponding to the parsing result, and return the external storage path corresponding to the parsing result to the authentication request container.

[0165] In one embodiment, an authentication service system is provided, comprising an authentication request container and an authentication service container. The authentication service container runs a first operating system and includes a virtual machine running a second operating system. The virtual machine includes an authentication service module and an authentication tool module, wherein:

[0166] The authentication request container is used to send authentication requests to the authentication service module.

[0167] The authentication service module is used to determine the storage path of the data to be authenticated in response to an authentication request.

[0168] The identification tool module is used to retrieve the data to be identified based on the storage path.

[0169] The identification tool module is also used to identify the data to be identified and obtain the identification results.

[0170] It is understood that the functions that the authentication service container can achieve are described in the above embodiments.

[0171] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 5 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a data authentication method.

[0172] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0173] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0174] The authentication service module responds to the authentication request and determines the storage path corresponding to the data to be authenticated.

[0175] The identification tool module retrieves the data to be identified based on the storage path;

[0176] The identification tool module identifies the data to be identified and obtains the identification results.

[0177] In the aforementioned computer equipment, by adding a virtual machine running a second operating system to the authentication service container running a first operating system, and setting up an authentication service module and an authentication tool module within the virtual machine, the authentication service module adapted to the second operating system, running within the authentication service container running the first operating system, can respond to authentication requests sent by the authentication request container and determine the storage path corresponding to the data to be authenticated. The authentication tool module adapted to the second operating system, running within the authentication service container running the first operating system, can retrieve the data to be authenticated according to the storage path, authenticate the data, and obtain the authentication result. Thus, this application achieves the goal of enabling the authentication tool module to run normally on non-adapted operating systems, improving the applicability of the authentication tool module.

[0178] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0179] The identification service module generates an identification start command containing the storage path and sends the identification start command to the identification tool module; the identification tool module parses the identification start command to obtain the storage path and retrieves the data to be identified based on the storage path.

[0180] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0181] The authentication service module parses the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated stored in the external storage. The authentication service module maps the external storage path to the internal mount path in the network file system. The authentication tool module obtains the data to be authenticated through the network file system based on the internal mount path.

[0182] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0183] The authentication service module parses the authentication results to obtain the parsing results; the authentication service module stores the parsing results in the external storage memory according to the external storage path corresponding to the parsing results; the authentication service module returns the external storage path corresponding to the parsing results to the authentication request container.

[0184] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0185] The authentication service module receives authentication requests sent by the authentication request container via remote procedure call through the remote procedure call interface on the authentication service container; the authentication service module determines the storage path corresponding to the data to be authenticated based on the authentication request.

[0186] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0187] Create a virtual machine network corresponding to the virtual machine in the authentication service container; start the virtual machine in the virtual machine network; the authentication service module obtains the authentication service program, and the authentication tool module obtains the authentication tool program, so as to realize the authentication function by running the authentication service program and the authentication tool program.

[0188] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0189] In response to the detection that the virtual machine image associated with the virtual machine is corrupted or that the virtual machine image occupies a space threshold in external storage, the system checks whether the virtual machine image carries a rollback mark. If the virtual machine image carries a rollback mark, the system rolls back the virtual machine image according to the snapshot corresponding to the virtual machine image, so that the virtual machine is restored to the state where the identification tool module was successfully activated, and the rollback mark is cleared. The snapshot is created after the identification tool module is successfully activated.

[0190] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0191] The authentication service module responds to the authentication request and determines the storage path corresponding to the data to be authenticated.

[0192] The identification tool module retrieves the data to be identified based on the storage path;

[0193] The identification tool module identifies the data to be identified and obtains the identification results.

[0194] In the aforementioned computer-readable storage medium, by adding a virtual machine running a second operating system to the authentication service container running a first operating system, and setting up an authentication service module and an authentication tool module within the virtual machine, the authentication service module adapted to the second operating system, running within the authentication service container running the first operating system, can respond to authentication requests sent by the authentication request container and determine the storage path corresponding to the data to be authenticated. The authentication tool module adapted to the second operating system, running within the authentication service container running the first operating system, can retrieve the data to be authenticated according to the storage path, authenticate the data, and obtain the authentication result. Thus, this application achieves the goal of enabling the authentication tool module to run normally on non-adapted operating systems, improving the applicability of the authentication tool module.

[0195] In one embodiment, when the computer program is executed by a processor, it further performs the following steps:

[0196] The identification service module generates an identification start command containing the storage path and sends the identification start command to the identification tool module; the identification tool module parses the identification start command to obtain the storage path and retrieves the data to be identified based on the storage path.

[0197] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0198] The authentication service module parses the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated stored in the external storage. The authentication service module maps the external storage path to the internal mount path in the network file system. The authentication tool module obtains the data to be authenticated through the network file system based on the internal mount path.

[0199] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0200] The authentication service module parses the authentication results to obtain the parsing results; the authentication service module stores the parsing results in the external storage memory according to the external storage path corresponding to the parsing results; the authentication service module returns the external storage path corresponding to the parsing results to the authentication request container.

[0201] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0202] The authentication service module receives authentication requests sent by the authentication request container via remote procedure call through the remote procedure call interface on the authentication service container; the authentication service module determines the storage path corresponding to the data to be authenticated based on the authentication request.

[0203] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0204] Create a virtual machine network corresponding to the virtual machine in the authentication service container; start the virtual machine in the virtual machine network; the authentication service module obtains the authentication service program, and the authentication tool module obtains the authentication tool program, so as to realize the authentication function by running the authentication service program and the authentication tool program.

[0205] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0206] In response to the detection that the virtual machine image associated with the virtual machine is corrupted or that the virtual machine image occupies a space threshold in external storage, the system checks whether the virtual machine image carries a rollback mark. If the virtual machine image carries a rollback mark, the system rolls back the virtual machine image according to the snapshot corresponding to the virtual machine image, so that the virtual machine is restored to the state where the identification tool module was successfully activated, and the rollback mark is cleared. The snapshot is created after the identification tool module is successfully activated.

[0207] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0208] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0209] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A data authentication method, characterized in that, The method is applied to an authentication service container running a first operating system, the authentication service container including a virtual machine running a second operating system, the virtual machine including an authentication service module and an authentication tool module; The authentication service container also includes a network file system; the method includes: In response to the authentication request, the authentication service module determines the storage path corresponding to the data to be authenticated, including: The authentication service module parses the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated being stored in the external storage. Map the external storage path to an internal mount path in the network file system; The identification tool module obtains the data to be identified according to the storage path, including: The identification tool module obtains the data to be identified through the network file system according to the internal mount path; The identification tool module identifies the data to be identified and obtains the identification result; The identification service module parses the identification results to obtain the analysis results; The authentication service module stores the parsing result to the external storage via the network file system according to the internal mount path corresponding to the parsing result; The authentication service module maps the internal mounting path corresponding to the parsing result to the external storage path corresponding to the parsing result, and returns the external storage path corresponding to the parsing result to the authentication request container.

2. The method according to claim 1, characterized in that, The method further includes: The identification service module generates an identification start command containing the storage path and sends the identification start command to the identification tool module; The identification tool module obtains the data to be identified according to the storage path, including: The identification tool module parses the identification start command to obtain the storage path, and retrieves the data to be identified based on the storage path.

3. The method according to claim 1, characterized in that, In response to the authentication request, the authentication service module determines the storage path corresponding to the data to be authenticated, including: The authentication service module receives authentication requests sent by the authentication request container via remote procedure call through the remote procedure call interface on the authentication service container; The authentication service module determines the storage path corresponding to the data to be authenticated based on the authentication request.

4. The method according to claim 1, characterized in that, Before the authentication service module responds to the authentication request, it also includes: Create a virtual machine network corresponding to the virtual machine in the authentication service container; Start the virtual machine in the virtual machine network; The identification service module acquires the identification service program, and the identification tool module acquires the identification tool program, so as to realize the identification function by running the identification service program and the identification tool program.

5. The method according to claim 4, characterized in that, The method further includes: In response to detecting that the virtual machine image associated with the virtual machine is corrupted or that the virtual machine image occupies a space threshold in external storage, it is detected whether the virtual machine image carries a rollback mark; If the virtual machine image carries a rollback flag, then the virtual machine image is rolled back according to the snapshot corresponding to the virtual machine image, so that the virtual machine is restored to the state where the identification tool module is successfully activated, and the rollback flag is cleared. The snapshot is created after the identification tool module is successfully activated.

6. An authentication service container, characterized in that, The authentication service container runs a first operating system, and includes a virtual machine running a second operating system. The virtual machine includes an authentication service module and an authentication tool module. The authentication service container also includes a network file system. The authentication service module is specifically used to parse the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated being stored in the external storage. Map the external storage path to an internal mount path in the network file system; The identification tool module obtains the data to be identified through the network file system according to the internal mount path; The identification tool module is also used to identify the data to be identified and obtain the identification result; The identification service module is also used to parse the identification results to obtain the analysis results; Based on the internal mount path corresponding to the parsing result, the parsing result is stored in the external storage via the network file system; The authentication service module is further configured to map the internal mounting path corresponding to the parsing result to the external storage path corresponding to the parsing result, and return the external storage path corresponding to the parsing result to the authentication request container.

7. The identification service container according to claim 6, characterized in that, The identification service module is also used to generate an identification start command containing the storage path and send the identification start command to the identification tool module; The identification tool module is specifically used to parse the identification start command to obtain the storage path, and to obtain the data to be identified according to the storage path.

8. An authentication service system, characterized in that, The system includes an authentication request container and an authentication service container. The authentication service container runs a first operating system and includes a virtual machine running a second operating system. The virtual machine includes an authentication service module and an authentication tool module. The authentication service container also includes a network file system. The authentication request container is used to send authentication requests to the authentication service module; The authentication service module is specifically used to parse the authentication request sent by the authentication request container to obtain the external storage path corresponding to the data to be authenticated being stored in the external storage. Map the external storage path to an internal mount path in the network file system; The identification tool module is specifically used to obtain the data to be identified through the network file system according to the internal mount path; The identification tool module is also used to identify the data to be identified and obtain the identification result; The authentication service module is also used to parse the authentication result to obtain the parsing result; and to store the parsing result in the external storage through the network file system according to the internal mount path corresponding to the parsing result. The identification tool module is further configured to map the internal mounting path corresponding to the parsing result to the external storage path corresponding to the parsing result, and return the external storage path corresponding to the parsing result to the identification request container.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 5.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method, system and device for searching and killing computer virus

    CN102419803A

  • Validity verification system and method based on virtual machine protection data

    CN111580929A