[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN116112406A - Nuclear resource allocation method and device, electronic equipment and storage medium - Google Patents

Nuclear resource allocation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116112406A
CN116112406A CN202211661996.1A CN202211661996A CN116112406A CN 116112406 A CN116112406 A CN 116112406A CN 202211661996 A CN202211661996 A CN 202211661996A CN 116112406 A CN116112406 A CN 116112406A
Authority
CN
China
Prior art keywords
test
core
determining
port
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211661996.1A
Other languages
Chinese (zh)
Other versions
CN116112406B (en
Inventor
牛宏昌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Teletest Technology Co ltd
Original Assignee
Beijing Teletest Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Teletest Technology Co ltd filed Critical Beijing Teletest Technology Co ltd
Priority to CN202211661996.1A priority Critical patent/CN116112406B/en
Publication of CN116112406A publication Critical patent/CN116112406A/en
Application granted granted Critical
Publication of CN116112406B publication Critical patent/CN116112406B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/50Testing arrangements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to the field of network testing, in particular to a method, a device, electronic equipment and a storage medium for allocating nuclear resources, which comprise the steps of obtaining a test request, wherein the test request comprises a test case configured by a user and a port requirement of the user; determining a plurality of target ports from all physical ports based on port requirements; determining a test type based on the test case; further, according to the test type, determining the core resource configuration of each target port; and executing test tasks for the resource allocation and the test cases of any target port. The method and the device have the effect of improving the resource utilization rate in the tester.

Description

Nuclear resource allocation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of network testing, and in particular, to a method and apparatus for allocating core resources, an electronic device, and a storage medium.
Background
The network tester is oriented to research and development test scenes of routers, switches, application layer network equipment and the like, and provides network test services for research and development of the network tester. For multi-port network tester equipment, in order to ensure that the ports do not affect each other to perform parallel testing, a fixed available CPU core resource is generally allocated to each port. However, for different test scenarios, the core resource configuration for service simulation and message forwarding is different, and the fixed core resource configuration is difficult to exert the maximum performance of the network tester, so that the test range of the network tester is limited.
In the related art, the number of available ports is reduced by disabling part of ports of the network tester, so that the testing performance of a single port is improved, but the method is not applicable to network tester equipment with fewer ports or the situation that parallel testing is required. Therefore, how to improve the resource utilization of the network tester is a problem to be solved.
Disclosure of Invention
In order to improve the resource utilization rate of the network tester, the application provides a method, a device, electronic equipment and a storage medium for allocating nuclear resources.
In a first aspect, the present application provides a method for allocating core resources, which adopts the following technical scheme:
the method for allocating the nuclear resources comprises the steps of obtaining a test request, wherein the test request comprises a test case configured by a user and a port requirement of the user;
determining a plurality of target ports from all physical ports based on the port requirements, wherein any one of the target ports comprises at least two CPU core resources;
determining a test type based on the test case, wherein the test type comprises a message forwarding test and a service simulation test;
based on the test type, determining the core resource configuration of each target port, wherein the core resource configuration comprises the quantity respectively corresponding to a forwarding core for realizing a message forwarding function and a simulation core for realizing a service simulation function;
And executing a test task based on the core resource configuration of any target port and the test case.
By adopting the technical scheme, the test request sent by the user is obtained, wherein the test request comprises the test case configured by the user and the port requirement of the user; further determining the test type corresponding to the test case and a target port of the network tester, which needs to carry out the current test case; based on the test type, carrying out resource division on each target port, and determining the core resource configuration of each target port; and executing the corresponding test case on the basis of the determined core resource configuration. The network tester can reasonably allocate the core resources in the ports according to different testing scenes, and the testing performance of the tester can be improved.
In one possible implementation, determining the test type based on the test case includes:
determining bearing data from the test cases, wherein the bearing data comprises the number of bearing data packets and the data quantity contained in each bearing data packet;
judging whether the bearing data meets any preset condition, wherein the preset condition comprises that the number of the bearing data packets is larger than a first preset value, the data quantity contained in any bearing data packet is larger than a second preset value and the total data quantity in all bearing data packets is larger than a third preset value;
If yes, determining the test type corresponding to the test case as a message forwarding test;
if not, determining the test type corresponding to the test case as a service simulation test.
By adopting the technical scheme, the bearing data is determined from the test cases, the bearing data comprises the number of the bearing data packets and the data quantity contained in each bearing data packet, and whether the bearing data meets any preset condition is judged. When the bearing data meets any one of all preset conditions, determining that the test type corresponding to the test case is a message forwarding test, otherwise, determining that the test type corresponding to the test case is a service simulation test. By analyzing the test data in the test cases and judging by combining the characteristics of different test types, the accuracy of the determined test types can be improved.
In one possible implementation, determining the core resource configuration of any of the target ports based on the test type includes:
acquiring available core resources of any target port;
determining a resource ratio based on the test type, wherein the resource ratio is the ratio of the simulation core to the forwarding core;
and determining the core resource configuration of any target port based on the resource proportion and the available core resources.
By adopting the technical scheme, the available core resources of any target port are acquired, the resource proportion corresponding to the test type is determined based on the test type, and the core resources are functionally divided according to a more reasonable core resource distribution proportion (resource proportion). And further, according to the resource proportion and the available core resources, the core resource configuration of the target port is determined. According to different test types, the number of the simulation cores and the forwarding cores is dynamically adjusted, so that the test performance of the tester can be improved.
In one possible implementation manner, before acquiring the available core resources of the any target port, the method further includes:
acquiring total core resources, wherein the total core resources are all CPU core resources which can be used currently;
acquiring port attributes of all the physical ports;
and acquiring the available core resources of each physical port based on the total core resources and all the port attributes.
By adopting the technical scheme, the total core resources are acquired, the total core resources are all available CPU core resources, and the port attributes of all physical ports are acquired; and distributing the total core resources to each physical port based on the total core resources and all port attributes, and acquiring the available core resources of each physical port. According to the attribute of each physical port, the initial resource allocation is realized, and the rationality of the allocation of the available core resources of the physical ports can be improved.
In one possible implementation, determining the resource proportioning based on the test type includes:
determining the number of available core resources of any target port;
and determining a resource ratio based on the test type and the number of available core resources.
By adopting the technical scheme, the number of available core resources of any target port is determined, and the resource ratio of the target port is further determined according to the test type and the number of available core resources. The probability of abnormal CPU core resource allocation in the target port is reduced, the rationality of the resource proportion can be improved, and the testing performance of the tester is further improved.
In one possible implementation manner, based on the core resource configuration of any of the target ports and the test case, performing a test task includes:
determining corresponding message forwarding threads and service simulation threads based on the core resource configuration of any target port;
and executing test tasks based on the message forwarding thread, the service simulation thread and the test case.
By adopting the technical scheme, the message forwarding thread and the service simulation thread corresponding to each core are determined based on the core resource configuration of the target port; and executing the test task based on the message forwarding thread, the service simulation thread and the bearing data packet in the test case. According to the functions of the cores in the target port, functional threads corresponding to each core are determined for testing, the utilization rate of CPU core resources is improved, and the testing effect of the tester is improved.
In one possible implementation manner, a method for allocating core resources further includes:
determining the use states of all the target ports;
determining a test request progress based on all the use states;
and when the test request progress does not meet the preset progress requirement, generating an available port selection scheme.
By adopting the technical scheme, the use states of all the target ports are determined, the test request progress of the current test is determined based on all the use states, the test request progress is analyzed, the test request progress is judged to meet the preset progress requirement, when the test request progress is not met, an available port selection scheme is generated, and idle ports are selected for the user to test, so that the test efficiency is improved.
In a second aspect, the present application provides a core resource allocation apparatus, which adopts the following technical scheme:
a nuclear resource allocation apparatus comprising:
the test request acquisition module is used for acquiring a test request, wherein the test request comprises a test case configured by a user and a port requirement of the user;
the target port determining module is used for determining a plurality of target ports from all physical ports based on the port requirements, wherein any target port comprises at least two CPU core resources;
The test type determining module is used for determining a test type based on the test case, wherein the test type comprises a message forwarding test and a service simulation test;
the core resource configuration determining module is used for determining the core resource configuration of each target port based on the test type, wherein the core resource configuration comprises the quantity respectively corresponding to a forwarding core for realizing a message forwarding function and a simulation core for realizing a service simulation function;
and the test task execution module is used for executing the test task based on the core resource configuration of any target port and the test case.
In one possible implementation manner, when the test type determining module determines a test type based on the test case, the test type determining module is specifically configured to:
determining bearing data from the test cases, wherein the bearing data comprises the number of bearing data packets and the data quantity contained in each bearing data packet;
judging whether the bearing data meets any preset condition, wherein the preset condition comprises that the number of the bearing data packets is larger than a first preset value, the data quantity contained in any bearing data packet is larger than a second preset value and the total data quantity in all bearing data packets is larger than a third preset value;
If yes, determining the test type corresponding to the test case as a message forwarding test;
if not, determining the test type corresponding to the test case as a service simulation test.
In one possible implementation manner, when the core resource configuration determining module determines the core resource configuration of any of the target ports based on the test type, the method is specifically used for:
acquiring available core resources of any target port;
determining a resource ratio based on the test type, wherein the resource ratio is the ratio of the simulation core to the forwarding core;
and determining the core resource configuration of any target port based on the resource proportion and the available core resources.
In one possible implementation manner, a core resource allocation apparatus further includes:
the total core resource acquisition module is used for acquiring total core resources, wherein the total core resources are all CPU core resources which can be used currently;
the port attribute acquisition module is used for acquiring port attributes of all the physical ports;
and the available core resource determining module is used for acquiring the available core resource of each physical port based on the total amount of core resources and all the port attributes.
In one possible implementation manner, when the core resource configuration determining module determines the resource proportioning based on the test type, the method is specifically used for:
Determining the number of available core resources of any target port;
and determining a resource ratio based on the test type and the number of available core resources.
In one possible implementation manner, when the test task execution module executes a test task based on the core resource configuration of any of the target ports and the test case, the test task execution module is specifically configured to:
determining corresponding message forwarding threads and service simulation threads based on the core resource configuration of any target port;
and executing test tasks based on the message forwarding thread, the service simulation thread and the test case.
In one possible implementation manner, a core resource allocation apparatus further includes:
the use state determining module is used for determining the use states of all the target ports;
the test request progress determining module is used for determining the test request progress based on all the using states;
and the available port selection scheme generation module is used for generating an available port selection scheme when the test request progress does not meet the preset progress requirement.
By adopting the technical scheme, the test request sent by the user is obtained, wherein the test request comprises the test case configured by the user and the port requirement of the user; further determining the test type corresponding to the test case and a target port of the network tester, which needs to carry out the current test case; based on the test type, carrying out resource division on each target port, and determining the core resource configuration of each target port; and executing the corresponding test case on the basis of the determined core resource configuration. The network tester can reasonably allocate the core resources in the ports according to different testing scenes, and the testing performance of the tester can be improved.
In a third aspect, the present application provides an electronic device, which adopts the following technical scheme:
an electronic device, the electronic device comprising:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application configured to: and executing the core resource allocation method.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
a computer-readable storage medium, comprising: a computer program capable of being loaded by a processor and executing the above-described core resource allocation method is stored.
In summary, the present application includes at least one of the following beneficial technical effects:
1. acquiring a test request sent by a user, wherein the test request comprises a test case configured by the user and a port requirement of the user; further determining the test type corresponding to the test case and a target port of the network tester, which needs to carry out the current test case; based on the test type, carrying out resource division on each target port, and determining the core resource configuration of each target port; and executing the corresponding test case on the basis of the determined core resource configuration. The network tester can reasonably allocate the core resources in the ports according to different testing scenes, and the testing performance of the tester can be improved.
2. And determining bearing data from the test cases, wherein the bearing data comprises the number of bearing data packets and the data quantity contained in each bearing data packet, and judging whether the bearing data meets any preset condition. When the bearing data meets any one of all preset conditions, determining that the test type corresponding to the test case is a message forwarding test, otherwise, determining that the test type corresponding to the test case is a service simulation test. By analyzing the test data in the test cases and judging by combining the characteristics of different test types, the determined test types corresponding to the test cases can be more accurate.
3. The method comprises the steps of obtaining available core resources of any target port, determining a resource proportion corresponding to a test type based on the test type, and performing functional division on the core resources according to a more reasonable core resource allocation proportion (resource proportion). And further, according to the resource proportion and the available core resources, the core resource configuration of the target port is determined. According to different test types, the number of the simulation cores and the forwarding cores is dynamically adjusted, so that the test performance of the tester can be improved.
Drawings
FIG. 1 is a schematic flow chart of a method for allocating core resources in an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a core resource allocation device according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
The present application is described in further detail below in conjunction with fig. 1-3.
Modifications of the embodiments which do not creatively contribute to the invention may be made by those skilled in the art after reading the present specification, but are protected by patent laws only within the scope of claims of the present application.
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein, e.g
Without special explanation, it is generally indicated that the associated objects are an "or" relationship.
The embodiment of the application provides a method for allocating core resources, which is executed by electronic equipment, and referring to fig. 1, the method comprises steps S101-S105, wherein:
step S101, a test request is obtained, wherein the test request comprises a test case configured by a user and a port requirement of the user.
In the embodiment of the application, a test request sent by a user is obtained, wherein the test request comprises a test case configured by the user and a port requirement of the user. The test case comprises data to be tested, and the tested data are determined according to the test requirements of a user.
Further, the application is directed to a multi-port tester device, wherein a plurality of physical ports for testing exist in the tester device, and the physical ports are mutually independent, so that the requirement of parallel testing can be met. At least two CPU core resources are bound in each physical port, and all the usable CPU core resources are mutually independent. And the number of the core resources corresponding to each physical port can be the same or different. For example, the tester device X includes 20 CPU core resources, the numbers of which are No. 1 to No. 20, and the tester device includes two physical ports a and B, where the physical port a may use the CPU core resources numbered 1 to No. 10, and the physical port B may use the CPU core resources numbered 11 to No. 20. The tester equipment Y contains 10 CPU core resources, the numbers of the CPU core resources are respectively 1-10, the tester equipment comprises two physical ports C and D, the physical port C can use the CPU core resources of which the numbers are 1-3, and the physical port D can use the CPU core resources of which the numbers are 4-10. Port requirements are the requirements of the user to perform the test on the physical port.
Step S102, determining a plurality of target ports from all the physical ports based on the port requirements, wherein any target port comprises at least two CPU core resources.
In this embodiment of the present application, according to the port requirements of the user, the target ports for testing are determined from all the physical ports, and any one of the target ports includes at least two usable CPU core resources. The destination port may be one or more, specifically determined according to the port requirements of the user.
Step S103, determining a test type based on the test case, wherein the test type comprises a message forwarding test and a service simulation test.
In the embodiment of the application, the test data in the acquired test case is analyzed, the test type corresponding to the test case is judged, the test type comprises a message forwarding test and a service simulation test, wherein the message forwarding test is a capability test for transmitting data volume of a network, and the test case of the message forwarding test generally comprises more data volume to be transmitted than the service simulation test. The service simulation test is a capability test of the network for bearing the usage amount, and the bearing capability of the device to be tested on the mass accounts is tested by simulating the scene that the mass accounts are logged in simultaneously.
Further, testing is performed on various network scenes, and the corresponding test types are message forwarding test and service simulation test. For example, HTTPS (Hypertext Transfer Protocol Secure, hypertext transfer security protocol) test, FTP (File Transfer Protocol ) test, etc. Taking a service simulation test in an FTP test as an example, the tester equipment establishes a transmission link of an FTP file through a nuclear resource bound in a port by simulating a transmission flow of the file transmission, performs file transmission, and closes the transmission link to realize the test, so as to simulate a scene of carrying out file transmission on a mass account.
Step S104, based on the test type, determining the core resource configuration of each target port, wherein the core resource configuration comprises the number of forwarding cores for realizing the message forwarding function and the number of simulation cores for realizing the service simulation function, which are respectively corresponding.
In an embodiment of the present application, a core resource configuration for each target port is determined based on the test type. For different test types, the tester can exert better test performance by using corresponding core resource allocation. And after the test scene corresponding to the test request is identified, dynamically adjusting the use of CPU core resources in the target port, and distributing the CPU core resources in the target port to determine a simulation core for performing a message forwarding function and a simulation core for performing service simulation. For example, the target port a includes CPU core resources numbered 1 to 10, and the test type is a packet forwarding test, and then the CPU core resources numbered 1 to 3 are dynamically adjusted to be used as a simulation core for implementing service simulation, and the CPU core resources numbered 4 to 10 are used as forwarding cores for implementing packet forwarding.
Further, more CPU core resources are required to be allocated for service simulation test, and fewer CPU core resources are allocated for message forwarding; and the message forwarding test is opposite to the newly-built test, more CPU core resources are required to be allocated for message forwarding, and fewer CPU core resources are required to be allocated for service simulation. For the actual allocation quantity respectively corresponding to the forwarding core and the simulation core in different test types, the actual allocation quantity needs to be determined by combining with an actual application scene, and the embodiment of the application is not particularly limited.
Step S105, executing the test task based on the core resource configuration of any target port and the test case.
In the embodiment of the application, on the basis of the core resource configuration of the target port, the test function respectively executed by each CPU core resource in the target port is determined, the test task is executed on the test case configured by the user, and the test result is determined.
Acquiring a test request sent by a user, wherein the test request comprises a test case configured by the user and a port requirement of the user; further determining the test type corresponding to the test case and a target port of the network tester, which needs to carry out the current test case; based on the test type, carrying out resource division on each target port, and determining the core resource configuration of each target port; and executing the corresponding test case on the basis of the determined core resource configuration. The network tester can reasonably allocate the core resources in the ports according to different testing scenes, and the testing performance of the tester can be improved.
Further, based on the test case, a test type is determined, including step S1031 (not shown in the figure) -step S1034 (not shown in the figure), in which:
step S1031, determining bearer data from the test case, where the bearer data includes the number of bearer data packets and the data amount contained in each bearer data packet.
Specifically, the bearing data in the test case is determined, wherein the bearing data is the data needing to be subjected to network test. The carrying data comprises the number of carrying data packets and the data quantity contained in each carrying data packet, and the size and the number of the carrying data packets are determined according to the configuration of a user.
Step S1032, judging whether the bearing data meets any preset condition, wherein the preset condition comprises that the number of the bearing data packets is larger than a first preset value, the data quantity contained in any bearing data packet is larger than a second preset value and the total data quantity in all bearing data packets is larger than a third preset value;
step S1033, if yes, determining that the test type corresponding to the test case is a message forwarding test;
step S1034, if not, determining the test type corresponding to the test case as the service simulation test.
Specifically, the identification of the message forwarding test is realized through the bearing data, whether the bearing data meets any preset condition is judged, and then the test type corresponding to the test case is determined based on the judging result. Because the service simulation test focuses on the number of sessions which are quickly established/released per second, larger or more bearing data packets are not generally configured; in contrast to the service simulation test, the packet forwarding test is more focused on the carrying data to reach the maximum bandwidth, so that larger and more carrying data packets are generally configured in the test case. By judging the size and the number of the bearing data packets in the bearing data, whether the test case is applied to the message forwarding test or the service simulation test is distinguished.
The preset conditions include that the number of the bearing data packets is larger than a first preset value, the data amount contained in any bearing data packet is larger than a second preset value, and the total data amount contained in all bearing data packets is larger than a third preset value. For example, the first preset value is 10 ten thousand, the second preset value is 20G, and the third preset value may be 100G; the load data comprises 5 load data packets, and the data quantity corresponding to each load data packet is 5G, 15G, 20G, 25G and 10G respectively, and the test type of the test case is determined to be a message forwarding test. The specific values of the first preset value, the second preset value and the third preset value are not specifically limited in the embodiment of the application, and are determined according to the actual conditions of the test.
Further, when the load data in the test case meets any one of the preset conditions, that is, the test case needs to perform a large number of data forwarding tasks, and further, the test type corresponding to the test case is determined to be a message forwarding test. When the load data in the test case does not meet all the preset conditions, and the test case does not need to carry out a large amount of data forwarding, the test type corresponding to the test case is determined to be a business simulation test.
Further, based on the test type, a core resource configuration of any target port is determined, including step S1041 (not shown in the figure) -step S1043 (not shown in the figure), wherein:
step S1041, obtaining available core resources of any target port.
Specifically, available core resources in the target ports are acquired, and the available core resources are bound with the corresponding target ports. The available core resources in the target port can be determined based on the corresponding relation between the port IP and the CPU core resources; the available core resources in the target port may also be determined by scanning the target port, and the method for obtaining the available core resources in the target port is not specifically limited in the embodiment of the present application.
Step S1042, based on the test type, determining the resource ratio, wherein the resource ratio is the ratio of the simulation core to the forwarding core.
Specifically, based on the test type, a corresponding resource ratio is determined, where the resource ratio is a ratio between the simulation core and the forwarding core in the target port. In order to improve the utilization rate of the CPU core resources, for different test types, the core resources need to be configured pertinently based on the requirements/test principles of the test types. For the message forwarding test, more CPU core resources are needed as forwarding cores to execute the message forwarding task, and fewer CPU core resources are needed as simulation cores to execute the service simulation task. For the service simulation test, more CPU core resources are needed to be used as simulation cores to execute the service simulation task, and fewer CPU core resources are needed to be used as forwarding cores to execute the message forwarding task, which is opposite to the message forwarding test. For example, the ratio between the forwarding core and the emulation core corresponding to the service emulation test is 3:7, preparing a base material; the ratio between the forwarding core and the simulation core corresponding to the message forwarding test is 6:4. the actual ratio of the emulation core to the forwarding core is not specifically defined in the embodiments of the present application.
Further, the resource proportion of different test types can be determined by carrying out experiments of different proportions for a plurality of times, and the proportion of the simulation core with the best test performance to the simulation core is the corresponding resource proportion.
Step S1043, determining a core resource configuration of any target port based on the resource ratio and the available core resources.
Specifically, based on available core resources and resource proportions of the target port, the core resource configuration corresponding to the target port is determined. For example, the available core resources of the target port a are No. 1 to No. 10, and the resource ratio is 7: and 3, taking the core 1 to the core 7 in the target port A as a simulation core and the core 8 to the core 10 as a forwarding core. Wherein, the corresponding number of core resources can be randomly selected to execute different functions; the function to be executed by each core resource can also be determined by making a corresponding number for each available core resource.
Further, before obtaining the available core resources of any target port, step S001 (not shown in the figure) -step S003 (not shown in the figure) is further included, where:
and S001, acquiring total core resources which are all CPU core resources currently available.
In the embodiment of the application, all the CPU core resources which can be used currently are obtained as total core resources. The total nuclear resource can be obtained by scanning the tester equipment; the total core resource can also be obtained through the association information of the tester equipment and the CPU core resource. The method for obtaining the total core resources is not specifically limited in the embodiments of the present application.
Step S002, obtaining port attributes of all physical ports.
In the embodiment of the application, port attributes of all physical ports are obtained, wherein the port attributes comprise port capacity and port mode. Port capacities include, but are not limited to, 10G, 25G, 40G, 100G, etc., and port modes include, but are not limited to, four port, eight port, twenty four port, etc.
Step S003, based on the total amount of core resources and all port attributes, the available core resources of each physical port are obtained.
In the embodiment of the present application, according to the port attributes of all the physical ports, the existing total core resources are allocated to each physical port, and the available core resources of each physical port are obtained. The available core resources of each physical port are mutually independent, and the quantity of the available core resources is determined based on the port attribute and the total quantity of the core resources.
Further, based on the test type, a resource proportioning is determined, including a step SA (not shown in the figure) -a step SB (not shown in the figure), in which:
and step SA, determining the quantity of available core resources of any target port.
Specifically, the number of available core resources of any target port can be determined through a corresponding relation table between ports and the number of available core resources; the total amount of the available core resources can be calculated and determined to be the amount of the available core resources through all the available core resources in any target port. The manner in which the number of available core resources is determined is not particularly limited in the embodiments of the present application.
Step SB, determining the resource proportion based on the test type and the number of the available nuclear resources.
Specifically, the resource proportion of the target port is determined according to the test type of the target port and the number of available core resources. The resource ratios corresponding to the different numbers and the different test types can be determined through test experiments, so that a comparison relation table among the test types, the number of the nuclear resources and the resource ratios is determined, and the resource ratio corresponding to the target port is determined from the comparison relation table.
Further, based on the core resource configuration of any target port and the test case, a test task is performed, including step S1051 (not shown in the figure) -step S1052 (not shown in the figure), wherein:
step S1051, determining a corresponding message forwarding thread and a corresponding service emulation thread based on the core resource configuration of any target port.
Specifically, based on the core resource configuration of any target port, corresponding message forwarding threads are built in all forwarding cores of the target port, and corresponding core service simulation threads are built in all simulation cores. The tester equipment runs in a process mode, and executes different threads on different CPU core resources, so that the function of executing different tasks is achieved.
Step S1052, executing the test task based on the message forwarding thread, the service simulation thread and the test case.
Specifically, the data to be tested of the test case are put into the established message forwarding thread and the service simulation thread, and the test task is executed.
Further, when the target port selected by the user is still executing other testing tasks, a long waiting time is required, and in order to accelerate the testing process, a core resource allocation method further includes step S111 (not shown in the figure) -step S113 (not shown in the figure), wherein:
step S111, determining the use states of all the target ports.
In the embodiment of the application, after determining the target ports required by the test based on the port requirements, the use states of all the target ports at the current moment are determined by scanning the target ports. For example, the usage state of the target port a is idle; the usage state of the destination port B is in queue.
Step S112, determining the test request progress based on all the use states.
In the embodiment of the application, based on the use states of all the target ports, determining the test request progress, wherein the test request progress comprises the waiting time for executing the test request and the currently-proceeding test node.
Step S113, when the test request progress does not meet the preset progress requirement, an available port selection scheme is generated.
In the embodiment of the application, the test request progress is judged to be in accordance with the preset progress requirement, and when the test request progress does not meet the preset progress requirement, it is determined that the current test request is blocked, and a process blockage situation possibly exists. And further, an available port selection scheme corresponding to the test request is determined, so that a user is helped to improve the test efficiency, and delay time caused by port occupation is reduced. The preset progress requirement includes, but is not limited to, that the duration that the test needs to wait is less than the preset duration, and the currently performed test node is behind the preset node. The size of the preset duration and the specific numerical value of the preset interval cis-position are not particularly limited in the embodiment of the present application.
The above embodiment describes a method for allocating core resources from the aspect of a method flow, and the following embodiment describes an apparatus for allocating core resources from the aspect of a virtual module or a virtual unit, which is specifically described in the following embodiment.
An embodiment of the present application provides a device for allocating core resources, as shown in fig. 2, where the device for allocating core resources may specifically include a test request acquisition module 201, a target port determining module 202, a test type determining module 203, a core resource configuration determining module 204, and a test task executing module 205, where:
A test request acquisition module 201, configured to acquire a test request, where the test request includes a test case configured by a user and a port requirement of the user;
a target port determining module 202, configured to determine a plurality of target ports from all the physical ports based on the port requirements, where any target port includes at least two CPU core resources;
the test type determining module 203 is configured to determine a test type based on the test case, where the test type includes a message forwarding test and a service simulation test;
the core resource configuration determining module 204 is configured to determine, based on the test type, a core resource configuration of each target port, where the core resource configuration includes a number of forwarding cores that implement a packet forwarding function and a number of simulation cores that implement a service simulation function, where the number of forwarding cores corresponds to the number of simulation cores;
the test task execution module 205 is configured to execute a test task based on the core resource configuration of any target port and the test case.
In one possible implementation, when the test type determining module 203 determines a test type based on a test case, it is specifically configured to:
determining bearing data from the test cases, wherein the bearing data comprises the number of bearing data packets and the data quantity contained in each bearing data packet;
Judging whether the bearing data meets any preset condition, wherein the preset condition comprises that the number of the bearing data packets is larger than a first preset value, the data quantity contained in any bearing data packet is larger than a second preset value and the total data quantity in all bearing data packets is larger than a third preset value;
if yes, determining the test type corresponding to the test case as a message forwarding test;
if not, determining the test type corresponding to the test case as a service simulation test.
In one possible implementation, when the core resource configuration determining module 204 determines the core resource configuration of any target port based on the test type, the method specifically is used for:
acquiring available core resources of any target port;
determining a resource ratio based on the test type, wherein the resource ratio is the ratio of the simulation core to the forwarding core;
based on the resource proportioning and the available core resources, the core resource configuration of any target port is determined.
In one possible implementation manner, a core resource allocation apparatus further includes:
the total core resource acquisition module is used for acquiring total core resources which are all CPU core resources currently available;
the port attribute acquisition module is used for acquiring port attributes of all physical ports;
And the available core resource determining module is used for acquiring the available core resources of each physical port based on the total core resources and all port attributes.
In one possible implementation, when the core resource configuration determination module 204 determines the resource proportioning based on the test type, it is specifically configured to:
determining the number of available core resources of any target port;
and determining the resource proportion based on the test type and the number of available core resources.
In one possible implementation manner, when the test task execution module 205 executes a test task based on the core resource configuration of any target port and the test case, the method specifically is used for:
based on the nuclear resource configuration of any target port, determining a corresponding message forwarding thread and a corresponding service simulation thread;
based on the message forwarding thread, the service simulation thread and the test case, executing the test task.
In one possible implementation manner, a core resource allocation apparatus further includes:
the use state determining module is used for determining the use states of all the target ports;
the test request progress determining module is used for determining the test request progress based on all the using states;
and the available port selection scheme generation module is used for generating an available port selection scheme when the test request progress does not meet the preset progress requirement.
In an embodiment of the present application, as shown in fig. 3, an electronic device 300 shown in fig. 3 includes: a processor 301 and a memory 303. Wherein the processor 301 is coupled to the memory 303, such as via a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that, in practical applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 is not limited to the embodiment of the present application.
The processor 301 may be a CPU (Central Processing Unit ), general purpose processor, DSP (Digital Signal Processor, data signal processor), ASIC (Application Specific Integrated Circuit ), FPGA (Field Programmable Gate Array, field programmable gate array) or other programmable logic device, transistor logic device, hardware components, or any combination thereof. Which may implement or perform the various exemplary logic blocks, modules, and circuits described in connection with this disclosure. Processor 301 may also be a combination that implements computing functionality, e.g., comprising one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
Bus 302 may include a path that communicates information between the components described above. Bus 302 may be a PCI (Peripheral Component Interconnect, peripheral component interconnect Standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. Bus 302 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 3, but not only one bus or one type of bus.
The Memory 303 may be, but is not limited to, a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory ) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory ), a CD-ROM (Compact Disc Read Only Memory, compact disc Read Only Memory) or other optical disk storage, optical disk storage (including compact discs, laser discs, optical discs, digital versatile discs, blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 303 is used for storing application program codes for executing the present application and is controlled to be executed by the processor 301. The processor 301 is configured to execute the application code stored in the memory 303 to implement what is shown in the foregoing method embodiments.
Among them, electronic devices include, but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. But may also be a server or the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
The present application provides a computer readable storage medium having a computer program stored thereon, which when run on a computer, causes the computer to perform the corresponding method embodiments described above.
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited in order and may be performed in other orders, unless explicitly stated herein. Moreover, at least some of the steps in the flowcharts of the figures may include a plurality of sub-steps or stages that are not necessarily performed at the same time, but may be performed at different times, the order of their execution not necessarily being sequential, but may be performed in turn or alternately with other steps or at least a portion of the other steps or stages.
The foregoing is only a partial embodiment of the present application and it should be noted that, for a person skilled in the art, several improvements and modifications can be made without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for allocating core resources, comprising:
acquiring a test request, wherein the test request comprises a test case configured by a user and a port requirement of the user;
determining a plurality of target ports from all physical ports based on the port requirements, wherein any one of the target ports comprises at least two CPU core resources;
determining a test type based on the test case, wherein the test type comprises a message forwarding test and a service simulation test;
based on the test type, determining the core resource configuration of each target port, wherein the core resource configuration comprises the quantity respectively corresponding to a forwarding core for realizing a message forwarding function and a simulation core for realizing a service simulation function;
and executing a test task based on the core resource configuration of any target port and the test case.
2. The method of claim 1, wherein determining a test type based on the test case comprises:
Determining bearing data from the test cases, wherein the bearing data comprises the number of bearing data packets and the data quantity contained in each bearing data packet;
judging whether the bearing data meets any preset condition, wherein the preset condition comprises that the number of the bearing data packets is larger than a first preset value, the data quantity contained in any bearing data packet is larger than a second preset value and the total data quantity in all bearing data packets is larger than a third preset value;
if yes, determining the test type corresponding to the test case as a message forwarding test;
if not, determining the test type corresponding to the test case as a service simulation test.
3. The method of claim 1, wherein determining the core resource configuration of any of the target ports based on the test type comprises:
acquiring available core resources of any target port;
determining a resource ratio based on the test type, wherein the resource ratio is the ratio of the simulation core to the forwarding core;
and determining the core resource configuration of any target port based on the resource proportion and the available core resources.
4. A method of allocating core resources according to claim 3, further comprising, prior to acquiring the available core resources of any of the destination ports:
Acquiring total core resources, wherein the total core resources are all CPU core resources which can be used currently;
acquiring port attributes of all the physical ports;
and acquiring the available core resources of each physical port based on the total core resources and all the port attributes.
5. A method of allocating core resources according to claim 3, wherein said determining a resource ratio based on said test type comprises:
determining the number of available core resources of any target port;
and determining a resource ratio based on the test type and the number of available core resources.
6. The method for allocating core resources according to claim 1, wherein the performing a test task based on the core resource configuration of any of the target ports and the test case comprises:
determining corresponding message forwarding threads and service simulation threads based on the core resource configuration of any target port;
and executing test tasks based on the message forwarding thread, the service simulation thread and the test case.
7. The method of allocating core resources according to claim 1, further comprising:
determining the use states of all the target ports;
Determining a test request progress based on all the use states;
and when the test request progress does not meet the preset progress requirement, generating an available port selection scheme.
8. A nuclear resource allocation apparatus, comprising:
the test request acquisition module is used for acquiring a test request, wherein the test request comprises a test case configured by a user and a port requirement of the user;
the target port determining module is used for determining a plurality of target ports from all physical ports based on the port requirements, wherein any target port comprises at least two CPU core resources;
the test type determining module is used for determining a test type based on the test case, wherein the test type comprises a message forwarding test and a service simulation test;
the core resource allocation module is used for determining the core resource allocation of each target port based on the test type, wherein the core resource allocation comprises the quantity respectively corresponding to a forwarding core for realizing a message forwarding function and a simulation core for realizing a service simulation function;
and the test task execution module is used for executing the test task based on the core resource configuration of any target port and the test case.
9. An electronic device, comprising:
at least one processor;
a memory;
at least one application, wherein the at least one application is stored in memory and configured to be executed by at least one processor, the at least one application configured to: performing the core resource allocation method of any of claims 1-7.
10. A computer-readable storage medium, comprising: a computer program stored which can be loaded by a processor and which performs the method according to any of claims 1-7.
CN202211661996.1A 2022-12-23 2022-12-23 Nuclear resource allocation method and device, electronic equipment and storage medium Active CN116112406B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211661996.1A CN116112406B (en) 2022-12-23 2022-12-23 Nuclear resource allocation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211661996.1A CN116112406B (en) 2022-12-23 2022-12-23 Nuclear resource allocation method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116112406A true CN116112406A (en) 2023-05-12
CN116112406B CN116112406B (en) 2024-09-06

Family

ID=86260778

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211661996.1A Active CN116112406B (en) 2022-12-23 2022-12-23 Nuclear resource allocation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116112406B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180254969A1 (en) * 2017-03-06 2018-09-06 Ixia Methods, systems and computer readable media for providing receive port resiliency in a network equipment test device
CN114138482A (en) * 2021-11-26 2022-03-04 江苏省未来网络创新研究院 An NTA device configuration strategy method for automatically adapting hardware resources
CN115134281A (en) * 2022-06-29 2022-09-30 苏州浪潮智能科技有限公司 Network consumption source type component performance test optimization method, system and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180254969A1 (en) * 2017-03-06 2018-09-06 Ixia Methods, systems and computer readable media for providing receive port resiliency in a network equipment test device
CN114138482A (en) * 2021-11-26 2022-03-04 江苏省未来网络创新研究院 An NTA device configuration strategy method for automatically adapting hardware resources
CN115134281A (en) * 2022-06-29 2022-09-30 苏州浪潮智能科技有限公司 Network consumption source type component performance test optimization method, system and device

Also Published As

Publication number Publication date
CN116112406B (en) 2024-09-06

Similar Documents

Publication Publication Date Title
CN108023829B (en) Message processing method and device, storage medium and electronic equipment
US20180285294A1 (en) Quality of service based handling of input/output requests method and apparatus
CN109254913B (en) Device sharing method and device, electronic device and computer storage medium
CN106571978B (en) Data packet capturing method and device
WO2020164476A1 (en) Data downloading method and related apparatus
CN112448984A (en) Resource transmission method, electronic device and computer storage medium
WO2014194704A1 (en) A grouping processing method and system
WO2019076213A1 (en) Network control method and device
US20150304227A1 (en) Queue Management Method and Apparatus
CN114257559A (en) Method and device for forwarding data message
CN116112406B (en) Nuclear resource allocation method and device, electronic equipment and storage medium
CN115002046A (en) Message processing method, NUMA node, electronic device and storage medium
US10228976B2 (en) Methods, systems, and computer readable media for balancing incoming connections across multiple cores
CN118170667A (en) Linux-based software performance test method, electronic equipment and storage medium
CN112511385B (en) A method, device and electronic device for generating test flow data
CN111162947A (en) PCRE hot switching method, network device and storage medium
CN117453396A (en) Task data processing method and device based on edge calculation and electronic equipment
CN116016595A (en) Internet of things wireless data uploading method, system and equipment
CN112231096B (en) Method, system, equipment and medium for task balancing of FPGA (field programmable Gate array) pooled resources
US9479579B2 (en) Grouping processing method and system
CN101894019B (en) System and method for network accelerated operation of embedded Linux operating system
CN108228337B (en) Configuration method of central processing unit and server suitable for the same
CN110704300A (en) TPC-DS automated test method and TPC-DS test system
CN112162901B (en) CPU utilization determination method, system, storage medium and electronic device
US11916792B2 (en) Vehicle communication control device and method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant