Address conversion method and device, electronic equipment and storage medium

By obtaining the original root port address of the device, converting it into a format that complies with the PCIE protocol, and dividing it into multiple partial addresses for partial conversion, it solves the problem of cumbersome and inaccurate manual calculations in the existing technology, and achieves efficient and accurate Address translation.

CN119003262APending Publication Date: 2024-11-22NINGCHANG INFORMATION TECH (HANGZHOU) CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411139115.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In the prior art, in the device address conversion based on the PCIE protocol, as the amount of injection address increases, manual calculations are large, calculation errors are prone to occur, and the process is cumbersome and inaccurate.

Method used

By obtaining the original root port address of the target device, converting it into the converted root port address according to the set format, then dividing it into multiple partial addresses according to the address conversion rules, and performing a division conversion to generate the target root port address to be injected. Use scripts to automatically complete address conversion to improve efficiency and accuracy.

Benefits of technology

It realizes automated and fast address conversion, reduces manual workload and difficulty, improves the accuracy and efficiency of address conversion, and ensures that the conversion results match the PCIE protocol.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119003262A_ABST
    Figure CN119003262A_ABST
Patent Text Reader

Abstract

The invention discloses an address conversion method and device, electronic equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring an original root port address of target equipment, and converting the original root port address according to a set format to obtain a converted first root port address; converting the first root port address according to an address conversion rule to obtain N partial addresses of the first root port address; wherein N is an integer greater than 1; and converting the N partial addresses according to a set system to obtain a target root port address to be injected, so as to improve the efficiency and accuracy of address conversion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an address conversion method, device, electronic device and storage medium. Background Art

[0002] Error Injection (EINJ) is a mechanism for injecting memory errors, often used to test and verify the error handling capabilities of a system. With EINJ, users can simulate hardware errors in memory to test whether the system's error detection, correction, and handling mechanisms are effective.

[0003] When performing address conversion for a device using the PCIE protocol based on EINJ, the endpoint address of the device is first obtained, and then its root port address is obtained, and then the specific conversion result of the root port address is manually calculated and then injected. However, this address conversion method will increase the amount of manual calculation as the number of injected addresses increases, and the manual calculation of the specific conversion result may have calculation errors, and the whole process is cumbersome and inaccurate. Summary of the invention

[0004] The present application provides an address conversion method to improve the efficiency and accuracy of address conversion.

[0005] In a first aspect, an address conversion method is provided, comprising:

[0006] Obtaining an original root port address of a target device, and converting the original root port address according to a set format to obtain a converted first root port address;

[0007] Converting the first root port address according to an address conversion rule to obtain N partial addresses of the first root port address; wherein N is an integer greater than 1;

[0008] The N partial addresses are converted according to a set base system to obtain a target root port address to be injected.

[0009] In an embodiment of the present application, first, the original root port address of the target device is obtained, and the original root port address is converted according to a set format to obtain a converted first root port address, so as to ensure that the converted first root port address matches the PCIE protocol; then, the first root port address is converted according to an address conversion rule to obtain N partial addresses of the first root port address; finally, the N partial addresses are converted according to a set base to obtain the target root port address to be injected, so as to ensure the validity of the target root port address. Compared with the prior art, which uses manual calculation to perform address conversion, the present application can automatically and quickly complete the address conversion through the script written, has strong usability and ease of use, improves the efficiency and accuracy of address conversion, and also reduces the manual workload and difficulty of work.

[0010] In some embodiments, the obtaining of the original root port address of the target device and converting the original root port address according to a set format to obtain a converted first root port address includes:

[0011] Acquire the original root port address of the target device according to the device information of the target device; wherein the device information includes at least one of the device type, device model, device location, and device manufacturer of the target device;

[0012] The original root port address is binary-converted, and the dot character in the original root port address is replaced with a preset character to obtain a converted first root port address.

[0013] Through the above method, the converted first root port address is matched with the standard format defined by the PCIE protocol, so as to ensure the accuracy of the calculation when performing the address conversion later.

[0014] In some embodiments, converting the first root port address according to an address conversion rule to obtain N partial addresses of the first root port address includes:

[0015] Based on an address division rule, the first root port address is divided into M partial addresses; wherein M is equal to N;

[0016] Convert the M partial addresses according to their respective address conversion rules;

[0017] Determine whether the converted M partial addresses satisfy their respective set number of bits;

[0018] If yes, then obtain N partial addresses of the first root port address;

[0019] If not, a zero padding operation is performed on the M partial addresses according to the respective set bit numbers to obtain N partial addresses of the first root port address.

[0020] Through the above method, the first root port address is first divided into M partial addresses according to the address division rules to ensure that each partial address can be targeted for address conversion, and the number of bits of the converted M partial addresses is set to judge, and the partial addresses that do not meet the requirements can be filled with zeros to make the N partial addresses valid and available.

[0021] In some embodiments, the number of set bits of each of the M partial addresses is not equal.

[0022] By setting the number of set bits of each of the M partial addresses to be unequal, each partial address is matched with the provisions of the PCIE protocol, and it is also ensured that there is no misalignment problem in the finally generated target root port address.

[0023] In some embodiments, before converting the first root port address according to the address conversion rule to obtain N partial addresses of the first root port address, the method further includes:

[0024] Performing a format check on the first root port address;

[0025] If it is detected that the format of the first root port address is inaccurate, a prompt message is output; wherein the prompt message at least includes the reason for the abnormal format of the first root port address and the abnormal characters.

[0026] Through the above method, the format of the converted first root port address can be checked again to further ensure the accuracy of the calculation during the conversion of the first root port address. In addition, if the format is inaccurate, a prompt message can be output to remind the user to take corresponding measures to solve the problem.

[0027] In some embodiments, the address translation rule is written based on at least one of a bus number, a device number, and a function number of the target device.

[0028] Through the above method, it is ensured to match the PCIE protocol so that each part of the address after conversion is valid and usable.

[0029] In a second aspect, an address conversion device is provided, comprising:

[0030] A format conversion module, used to obtain an original root port address of a target device, and convert the original root port address according to a set format to obtain a converted first root port address;

[0031] The address conversion module is used to convert the first root port address according to the address conversion rule to obtain N partial addresses of the first root port address; and to convert the N partial addresses according to a set base to obtain the target root port address to be injected.

[0032] In some embodiments, the format conversion module is specifically used to:

[0033] Acquire the original root port address of the target device according to the device information of the target device; wherein the device information includes at least one of the device type, device model, device location, and device manufacturer of the target device;

[0034] The original root port address is binary-converted, and the dot character in the original root port address is replaced with a preset character to obtain a converted first root port address.

[0035] According to a third aspect, an electronic device is provided, including:

[0036] A memory for storing a computer program; a processor for implementing any one of the method steps in the first aspect when executing the computer program stored in the memory.

[0037] According to a fourth aspect, a computer-readable storage medium is provided, wherein a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method steps described in any one of the first aspects are implemented.

[0038] For each aspect from the second to the fourth aspect and the technical effects that may be achieved by each aspect, please refer to the above description of the technical effects that can be achieved by the first aspect or various possible schemes in the first aspect, and no further details will be given here. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 A schematic diagram of an application scenario to which the embodiments of the present application are applicable is exemplified;

[0040] Figure 2 The following is a flowchart of an address conversion method provided by an embodiment of the present application;

[0041] Figure 3 An exemplary interface diagram of a user interface for displaying device information provided by an embodiment of the present application is shown;

[0042] Figure 4 A flowchart of a complete address conversion method provided by an embodiment of the present application is exemplified;

[0043] Figure 5 The following is a schematic diagram showing the structure of an address conversion device provided by an embodiment of the present application;

[0044] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is exemplarily shown. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.

[0046] The terms "first" and "second" in the specification and claims of the present application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive protection. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. "Multiple" in the present application can mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.

[0047] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description. It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0048] In some scenarios, an interface (ACPIPlatform ErrorInterface, ACPIPEI) is used during computer startup, which allows BIOS / UEFI to report errors using the error handling mechanism defined by ACPI. If an "ACPIPlatform Error Interface" error is encountered, this may mean that the computer encountered a serious problem during the startup process, which requires attention. This may be caused by a hardware failure, a firmware problem, or a system configuration error. The ACPIPEI mainly relies on BERT, ERST, and HEST to record errors; write parameters to ACPIPEI, the param1 file and param2 file under the / sys / kernel / debug / apei / einj path of the error injection framework. Param1 and param2 respectively indicate the specific type and location of the error injection.

[0049] At present, when performing address conversion for devices using the PCIE protocol based on EINJ, the endpoint address of the device is first obtained, and then its root port address is obtained, and then converted into a complete hexadecimal by manual calculation, and then injected. However, this address conversion method will increase the amount of manual calculation as the number of injected addresses increases, and the conversion result of manual calculation may have calculation errors, and the whole process is cumbersome and inaccurate.

[0050] In view of this, embodiments of the present application provide an address conversion method, device, electronic device, and storage medium to improve the efficiency and accuracy of address conversion.

[0051] The following is a brief introduction to the application scenarios to which the technical solutions of the embodiments of the present application can be applied. It should be noted that the application scenarios introduced below are only used to illustrate the embodiments of the present application and are not limited. In specific implementation, the technical solutions provided by the embodiments of the present application can be flexibly applied according to actual needs.

[0052] Figure 1 The following is a schematic diagram of an application scenario applicable to the embodiment of the present application. As shown in the figure, the application scenario mainly includes: a terminal 100 and a server 101. Among them, information can be exchanged between the terminal 100 and the server 101 through a communication network, and the communication mode adopted by the communication network may include: a wireless communication mode and a wired communication mode.

[0053] In some scenarios, the terminal 100 can access the network and communicate with the server 101 through cellular mobile communication technology, and the cellular mobile communication technology may include the fifth generation mobile communication (5th Generation Mobile Networks, 5G) technology.

[0054] In other scenarios, the terminal 100 may access the network and communicate with the server 101 via short-range wireless communication. The short-range wireless communication may include Wireless Fidelity (Wi-Fi) technology.

[0055] The present application embodiment does not impose any restriction on the number of the above-mentioned devices. Figure 1 As shown, only the terminal 100 and the server 101 are described as examples, and the above-mentioned devices and their respective functions are briefly introduced below.

[0056] The terminal 100 is a device that can provide voice and / or data connectivity to the user, including: a handheld terminal device with a wireless connection function, a vehicle-mounted terminal device, etc.

[0057] It should be noted that the terminal 100 includes but is not limited to: mobile phones, tablet computers, laptop computers, PDAs, mobile Internet devices (Mobile Internet Device, MID), wearable devices, virtual reality (Virtual Reality, VR) devices, augmented reality (Augmented Reality, AR) devices, wireless terminal devices in industrial control, wireless terminal devices in unmanned driving, wireless terminal devices in smart grids, wireless terminal devices in transportation safety, wireless terminal devices in smart cities, or wireless terminal devices in smart homes, etc.

[0058] In addition, a client related to address conversion may be installed on the terminal 100, and the client may be software (e.g., APP, browser, etc.), or a web page, applet, etc. In the embodiment of the present application, the terminal 100 may use the above client and may perform address conversion and injection with the server 101.

[0059] Furthermore, server 101 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), as well as big data and artificial intelligence platforms.

[0060] Further, in the embodiment of the present application, the server 101 may be equipped with an address conversion device corresponding to the client, and the address conversion device may be a script tool, which may be written based on Python language or other computer languages, and is used to process the address conversion task initiated by the user on the user interface of the terminal 100. For example, after selecting a device in the user interface on the terminal 100, the server 101 may obtain the root port address of the device, and then the server 101 may run the script tool to quickly convert the root port address into the target root port address to be injected.

[0061] To further illustrate the technical solution provided by the embodiment of the present application, this is described in detail below in conjunction with the accompanying drawings and specific implementation methods. Although the embodiment of the present application provides the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or no creative labor. In the steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiment of the present application. The method may be executed or executed in parallel in the actual processing process or when the device is executed in accordance with the method sequence shown in the embodiment or drawings.

[0062] Figure 2 The flowchart of an address conversion method provided by an embodiment of the present application is exemplified. The process can be executed by an address conversion device, which can be implemented by software and / or hardware to improve the efficiency and accuracy of address conversion. Figure 2 As shown, the process includes the following steps:

[0063] 201: Acquire the original root port address of the target device, and convert the original root port address according to a set format to obtain a converted first root port address.

[0064] In some embodiments, the Replace method may be used to convert the original root port address according to a set format to obtain a converted first root port address. Replace is a function in Python, VB, ASP, Windows, SQL, and Excel, and its functions are to perform a replacement operation.

[0065] In some embodiments, the original root port address of the target device is obtained, and the original root port address is converted according to a set format, which may be:

[0066] According to the device information of the target device, the original root port address of the target device is obtained; wherein the device information includes at least one of the device type, device model, device location, and device manufacturer of the target device; the original root port address is binary converted, and the dot character (.) in the original root port address is replaced with a preset character (for example, a colon character (:)), to obtain the converted first root port address, thereby matching the standard format defined by the PCIE protocol, so as to ensure the accuracy of the calculation when the address is automatically converted later.

[0067] In some embodiments, the device information of the target device may also include the capacity of the target device, the current PCIE rate of the device, the device status, the current PCIE width of the device, the maximum PCIE rate of the device, the maximum PCIE width of the device, etc.

[0068] In some other embodiments, obtaining the original root port address of the target device according to the device information of the target device may be: in response to a terminal (such as Figure 1 The spci command (or spci-vt command) for displaying the device information of all devices in the system is input on the user interface of the terminal 100 shown in FIG. 1 , and then the device information of all devices is displayed on the user interface, such as Figure 3 As shown, a schematic diagram of an interface of a user interface for displaying device information provided by an embodiment of the present application is exemplified.

[0069] exist Figure 3 In the user interface 300, the total number of devices included is 3; among them, the device type corresponding to device 1 is type A, the device model is X1, the device location is 06.00.00, and the device manufacturer is S1; the device type corresponding to device 2 is B, the device model is X2, the device location is 07.00.00, and the device manufacturer is S2; the device type corresponding to device 3 is C, the device model is X3, the device location is 08.00.00, and the device manufacturer is S3.

[0070] It should be noted that the above user interface 300 is only an example. In actual scenarios, more information can be displayed according to user needs, and the embodiments of the present application are not limited here.

[0071] 202: Convert the first root port address according to the address conversion rule to obtain N partial addresses of the first root port address, where N is an integer greater than 1.

[0072] In some embodiments, the first root port address is converted according to the address conversion rule to obtain N partial addresses of the first root port address, which can be: based on the address division rule, the first root port address is divided into M partial addresses; wherein M is equal to N; the M partial addresses are converted according to their respective address conversion rules; it is determined whether the converted M partial addresses meet their respective set bit numbers; if so, N partial addresses of the first root port address are obtained; if not, zero-filling operations are performed on the M partial addresses according to their respective set bit numbers to obtain N partial addresses of the first root port address.

[0073] Furthermore, the number of set bits of each of the M partial addresses is not equal.

[0074] For example, assume that the first root port address is divided into three partial addresses based on the address division rule, wherein the three partial addresses represent the bus number, device number, and function number corresponding to the target device in turn; the three partial addresses are converted according to their corresponding address conversion rules. If the three partial addresses after conversion do not meet their respective set bit numbers (assuming they are set to 8 bits, 5 bits, and 3 bits in turn), the first bit of each partial address is padded with zeros to make each partial address match the PCIE protocol regulations, thereby ensuring that there will be no misalignment problems during subsequent address conversion.

[0075] In some embodiments, the address division rule is written based on the split method. The split method is a function for splitting a string into multiple parts according to a specified separator, for example, the first root port address is divided according to spaces, another example, the first root port address is divided according to colon characters, and another example, the first root port address is divided according to other characters. Appropriate address division rules can be set according to actual conditions to divide the first root port address, and the embodiments of the present application are not limited here.

[0076] In other embodiments, the split method can also be used to split the first port root address into four parts, the first part of the address corresponds to the PCIE domain of the target device, the second part of the address corresponds to the bus number of the target device, the third part of the address corresponds to the device number of the target device, and the fourth part of the address corresponds to the function number of the target device, thereby performing a finer-grained division to make subsequent address conversion more accurate.

[0077] In some embodiments, the address translation rule is written based on at least one of a bus number, a device number, and a function number of the target device.

[0078] Taking the above division into three parts as an example, the address conversion rule of the first part of the address is written based on the bus number of the target device; the address conversion rule of the second part of the address is written based on the device number of the target device; the address conversion rule of the third part of the address is written based on the function number of the target device, thereby ensuring that each part of the address can be targeted for address conversion, so that each part of the address after conversion is valid and usable.

[0079] In some other embodiments, before converting the first address portion, the second address portion, and the third address portion of the first root port address respectively according to respective address conversion rules, the method further includes:

[0080] Perform format check on the first root port address; if the format of the first root port address is found to be inaccurate, output prompt information; wherein the prompt information at least includes the reason for the abnormal format of the first root port address and the abnormal characters.

[0081] In some embodiments, the prompt information may be displayed in a pop-up window, may be displayed directly on the current interface, or may be sent to an associated smart terminal for display. The specific display format is not limited.

[0082] Through the above method, the format of the converted first root port address can be checked again to further ensure the accuracy of the calculation during the conversion of the first root port address. In addition, if the format is inaccurate, a prompt message can be output to remind the user to take corresponding measures to solve the problem.

[0083] 203: Convert the N partial addresses according to the set base system to obtain the target root port address to be injected.

[0084] In this step, the N partial addresses may be connected in sequence to obtain a root port address in binary form, and then the root port address in binary form is converted into hexadecimal to obtain the target root port address to be injected.

[0085] In an embodiment of the present application, first, the original root port address of the target device is obtained, and the original root port address is converted according to a set format to obtain a converted first root port address, so as to ensure that the converted first root port address matches the PCIE protocol; then, the first root port address is converted according to an address conversion rule to obtain N partial addresses of the first root port address; finally, the N partial addresses are converted according to a set base to obtain the target root port address to be injected, so as to ensure the validity of the target root port address. Compared with the prior art, which uses manual calculation to perform address conversion, the present application can automatically and quickly complete the address conversion through the script written, has strong usability and ease of use, improves the efficiency and accuracy of address conversion, and also reduces the manual workload and difficulty of work.

[0086] Based on the above Figure 2 The method shown, Figure 4 The flowchart of a complete address conversion method provided by an embodiment of the present application is exemplified.

[0087] 401: Enter the lspci-vt command to obtain the original root port address of the target device, and use the replace method to replace the dot character in the original root port address with a colon character to obtain the converted first root port address.

[0088] 402: Use the split method to divide the first root port address to obtain a first address portion, a second address portion, and a third address portion of the first root port address.

[0089] 403: Convert the first part of the address, the second part of the address, and the third part of the address according to their respective address conversion rules, and determine whether the converted first part of the address, the second part of the address, and the third part of the address meet the requirements of the set bit number of 8 bits, 5 bits, and 3 bits respectively. If so, transfer to 404; if not, fill them with zeros respectively and then transfer to 404.

[0090] 404: The first address portion, the second address portion, and the third address portion that are converted and meet the set bit numbers are sequentially connected to form a root port address in binary form, and hexadecimal conversion is performed to obtain a target root port address to be injected.

[0091] For example, if the original root port address of the target device is 26:01.0, Figure 4 The method shown can directly output the target root port address to be injected as 0x260800, making it convenient for ENIJ to directly inject a reliable and useful target root port address.

[0092] Based on the same technical concept, an address conversion device is also provided in an embodiment of the present application, and the device can implement the above-mentioned address conversion method process in the embodiment of the present application.

[0093] Figure 5 The following is a schematic diagram showing the structure of an address conversion device provided by an embodiment of the present application. Figure 5 As shown, the device includes: a format conversion module 501 and an address conversion module 502.

[0094] The format conversion module 501 is used to obtain the original root port address of the target device, and convert the original root port address according to a set format to obtain a converted first root port address.

[0095] The address conversion module 502 is used to convert the first root port address according to the address conversion rule to obtain N partial addresses of the first root port address; and to convert the N partial addresses according to a set base to obtain the target root port address to be injected.

[0096] In some embodiments, the format conversion module 501 is specifically used to:

[0097] According to the device information of the target device, the original root port address of the target device is obtained; wherein the device information includes at least one of the device type, device model, device location, and device manufacturer of the target device; the original root port address is binary converted, and the dot character in the original root port address is replaced with a preset character to obtain a converted first root port address.

[0098] In some embodiments, the address conversion module 502 is further configured to:

[0099] Performing a format check on the first root port address;

[0100] If it is detected that the format of the first root port address is inaccurate, a prompt message is output; wherein the prompt message at least includes the reason for the abnormal format of the first root port address and the abnormal characters.

[0101] In some embodiments, the address conversion module 502 is specifically configured to:

[0102] Based on an address division rule, the first root port address is divided into M partial addresses; wherein M is equal to N;

[0103] Convert the M partial addresses according to their respective address conversion rules;

[0104] Determine whether the converted M partial addresses satisfy their respective set number of bits;

[0105] If yes, then obtain N partial addresses of the first root port address;

[0106] If not, a zero padding operation is performed on the M partial addresses according to the respective set bit numbers to obtain N partial addresses of the first root port address.

[0107] It should be noted here that the above-mentioned device provided in the embodiment of the present application can implement all the method steps in the above-mentioned method embodiment and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0108] Based on the same technical concept, an electronic device is also provided in an embodiment of the present application, and the electronic device can realize the function of the aforementioned address conversion device.

[0109] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is exemplarily shown.

[0110] At least one processor 601, and a memory 602 connected to the at least one processor 601. The specific connection medium between the processor 601 and the memory 602 is not limited in the embodiment of the present application. Figure 6 In the example, the processor 601 and the memory 602 are connected via a bus 600. Figure 6 The connection between other components is shown by bold lines, and is not intended to be limiting. The bus 600 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 601 can also be called a controller, and there is no limitation on the name.

[0111] In the embodiment of the present application, the memory 602 stores instructions that can be executed by at least one processor 601. The at least one processor 601 can execute an address conversion method discussed above by executing the instructions stored in the memory 602. The processor 601 can implement Figure 5 The functions of each module in the device shown.

[0112] Among them, the processor 601 is the control center of the device, and can use various interfaces and lines to connect the various parts of the entire control device. By running or executing instructions stored in the memory 602 and calling the data stored in the memory 602, the various functions of the device and processing data, the device can be monitored as a whole.

[0113] In the embodiment of the present application, the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 601. In some embodiments, the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented separately on separate chips.

[0114] The processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of an address conversion method disclosed in the embodiments of the present application may be directly embodied as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0115] The memory 602 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 602 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 602 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 602 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.

[0116] By programming the processor 601, the code corresponding to the address conversion method described in the above embodiment can be fixed into the chip, so that the chip can execute the code when running. Figure 2 The embodiment shown is an address conversion method. How to design and program the processor 601 is a technology well known to those skilled in the art and will not be described in detail here.

[0117] It should be noted here that the above-mentioned electronic device provided in the embodiment of the present application can implement all the method steps implemented in the above-mentioned method embodiment, and can achieve the same technical effect. The parts and beneficial effects of this embodiment that are the same as the method embodiment will not be described in detail here.

[0118] Based on the same technical concept, an embodiment of the present application provides a computer storage medium, the computer storage medium includes: a computer program code, when the computer program code is run on a computer, the computer executes any one of the address conversion methods discussed above. Since the principle of solving the problem by the above-mentioned computer storage medium is similar to that of an address conversion method, the implementation of the above-mentioned computer storage medium can refer to the implementation of the method, and the repeated parts will not be repeated.

[0119] In the specific implementation process, the computer storage medium may include: Universal Serial Bus Flash Drive (USB), mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk, and other storage media that can store program codes.

[0120] Based on the same technical concept, the embodiment of the present application also provides a computer program product, which includes: computer program code, when the computer program code is run on a computer, the computer executes any one of the address conversion methods discussed above. Since the principle of solving the problem by the above computer program product is similar to that of an address conversion method, the implementation of the above computer program product can refer to the implementation of the method, and the repeated parts will not be repeated.

[0121] The computer program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.

[0122] The method in the present application can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function described in the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0123] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0124] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) that contain computer-usable program code.

[0125] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the instructions in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0126] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0127] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. An address conversion method, characterized in that: include: Obtaining an original root port address of a target device, and converting the original root port address according to a set format to obtain a converted first root port address; Converting the first root port address according to an address conversion rule to obtain N partial addresses of the first root port address; wherein N is an integer greater than 1; The N partial addresses are converted according to a set base system to obtain a target root port address to be injected.

2. The method according to claim 1, characterized in that The step of obtaining an original root port address of the target device and converting the original root port address according to a set format to obtain a converted first root port address includes: Acquire the original root port address of the target device according to the device information of the target device; wherein the device information includes at least one of the device type, device model, device location, and device manufacturer of the target device; The original root port address is binary-converted, and the dot character in the original root port address is replaced with a preset character to obtain a converted first root port address.

3. The method according to claim 1, characterized in that The converting the first root port address according to the address conversion rule to obtain N partial addresses of the first root port address includes: Based on an address division rule, the first root port address is divided into M partial addresses; wherein M is equal to N; Convert the M partial addresses according to their respective address conversion rules; Determine whether the converted M partial addresses satisfy their respective set number of bits; If yes, then obtain N partial addresses of the first root port address; If not, a zero padding operation is performed on the M partial addresses according to the respective set bit numbers to obtain N partial addresses of the first root port address.

4. The method according to claim 3, characterized in that The number of set bits of the M partial addresses is not equal.

5. The method according to claim 1, characterized in that Before converting the first root port address according to the address conversion rule to obtain N partial addresses of the first root port address, the method further includes: Performing a format check on the first root port address; If it is detected that the format of the first root port address is inaccurate, a prompt message is output; wherein the prompt message at least includes the reason for the abnormal format of the first root port address and the abnormal characters.

6. The method according to any one of claims 1 to 5, characterized in that: The address conversion rule is written based on at least one of the bus number, device number, and function number of the target device.

7. An address conversion device, characterized in that: include: A format conversion module, used to obtain an original root port address of a target device, and convert the original root port address according to a set format to obtain a converted first root port address; An address conversion module, used for converting the first root port address according to an address conversion rule to obtain N partial addresses of the first root port address; And it is used to convert the N partial addresses according to a set base system to obtain the target root port address to be injected.

8. The device according to claim 7, characterized in that The format conversion module is specifically used for: Acquire the original root port address of the target device according to the device information of the target device; wherein the device information includes at least one of the device type, device model, device location, and device manufacturer of the target device; The original root port address is binary-converted, and the dot character in the original root port address is replaced with a preset character to obtain a converted first root port address.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to implement the method according to any one of claims 1 to 6 when executing a computer program stored in the memory.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.