Data processing method and device, equipment and storage medium
By adding a processing layer between the interface server and the page, and using encapsulation modules to automatically handle the adaptation of front-end display code when the network model changes, the inefficiency problem in the existing technology is solved, and efficient code modification and automated adaptation are achieved.
Patent Information
- Application Number
- CN202310896926.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-20
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2043-07-20
AI Technical Summary
In existing technologies, when the network model changes, the front-end display code needs to manually replace parameters and return values one by one, resulting in low efficiency and a large workload, especially in scenarios with multiple interfaces and multiple products.
By adding a processing layer between the interface server and the page, the encapsulation module obtains the return information of the interface when the target page is triggered, and determines whether the front-end display code needs to be adapted based on the return information, thus automatically handling the replacement of parameters and return values of the interface to be adapted.
It improves the efficiency of front-end code display changes, reduces repetitive work, avoids errors from manual search and replacement, and ensures the accuracy and efficiency of changes.
Smart Images

Figure CN116938739B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a data processing method, apparatus, device, and storage medium. Background Technology
[0002] As business grows, the number of tenants increases, requiring the network to isolate a massive number of tenants. The existing VLAN (Virtual Local Area Network) network model cannot support such a large number of tenants; therefore, a VXLAN (Virtual eXtential LAN) network model, capable of accommodating a large number of tenants, is needed.
[0003] As the network model is adjusted, the parameters and return values of the interface may change. In this case, the front-end code needs to be adjusted to adapt. For example, when the network model changes, the parameters and return values corresponding to the VLAN network model in the front-end display code need to be replaced with those corresponding to the VXLAN network model. For instance, `networkId` needs to be replaced with `vpcId`, and the return value corresponding to `networkId` needs to be replaced with the return value corresponding to `vpcId`. Current technology involves manually locating the interface call location and replacing the parameters and return values one by one using a find-and-replace method. When there are multiple interfaces, the above steps need to be repeated; when multiple products are involved, the above steps need to be repeated for each interface on each product.
[0004] The above method has the problem of low efficiency when the front-end display code is modified. Summary of the Invention
[0005] This invention provides a data processing method, apparatus, device, and storage medium to solve the problem of low efficiency when modifying front-end display code in the prior art.
[0006] In a first aspect, the present invention provides a data processing method, the method comprising:
[0007] Identify the interfaces to be adapted; the interfaces to be adapted refer to those whose attribute information changes when the first network model is changed to the second network model.
[0008] When a target page is detected to be triggered, the encapsulation module is invoked to send a network request to the interface server and obtain the return information corresponding to the target interface; the target page is the page that calls the target interface.
[0009] The target front-end display code is adapted based on the returned information and the interface to be adapted; the target front-end display code is the front-end display code corresponding to the target interface.
[0010] Optionally, the encapsulation module is invoked to send a network request to the interface server and obtain the return information corresponding to the target interface, including:
[0011] Determine the address information of the target interface;
[0012] The encapsulation module is invoked based on the address information of the target interface to obtain the return information corresponding to the target interface.
[0013] Optionally, the target front-end display code is adapted based on the returned information and the interface to be adapted, including:
[0014] Determine whether the address information of the target interface exists in the address array; the address array stores the address information of each of the interfaces to be adapted.
[0015] If it exists, then determine whether to adapt the target front-end display code based on the returned information and the attribute information corresponding to the interface to be adapted;
[0016] If it does not exist, then it is determined that the target front-end display code will not be adapted.
[0017] Optionally, the returned information includes a returned name; determining whether to adapt the target front-end display code based on the returned information and the attribute information corresponding to the interface to be adapted includes:
[0018] For any of the returned names, determine whether the returned name does not belong to the parameter corresponding to the first network model of the target interface but belongs to the parameter corresponding to the second network model of the target interface;
[0019] If so, then the target front-end display code will be adapted;
[0020] If not, then it is determined that the target front-end display code will not be adapted.
[0021] Optionally, the returned information also includes a return value corresponding to the returned name; adapting the target front-end display code includes:
[0022] Determine the first parameter of the target interface that corresponds to the returned name in the parameters corresponding to the first network model;
[0023] The return value is assigned to the first parameter.
[0024] Optionally, the method further includes:
[0025] After assigning the return value to the first parameter, or after determining that the target front-end display code is not adapted, the return value is returned to the target front-end display code for page display.
[0026] Optionally, the first network model is a VLAN network model; the second network model is a VXLAN network model.
[0027] In a second aspect, the present invention provides a data processing apparatus, the apparatus comprising:
[0028] The determination module is used to determine the interface to be adapted; the interface to be adapted refers to the interface whose attribute information changes when the first network model is changed to the second network model;
[0029] The calling module is used to call the encapsulation module to send a network request to the interface server and obtain the return information corresponding to the target interface when the target page is detected to be triggered; the target page is the page that calls the target interface;
[0030] An adaptation module is used to adapt the target front-end display code according to the returned information and the interface to be adapted; the target front-end display code is the front-end display code corresponding to the target interface.
[0031] Thirdly, the present invention provides an electronic device, comprising: at least one processor and a memory;
[0032] The memory stores the instructions that the computer executes;
[0033] At least one processor executes computer execution instructions stored in memory, causing at least one processor to perform the method as described in any of the first aspects.
[0034] Fourthly, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method of any one of the first aspects.
[0035] Fifthly, the present invention provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects.
[0036] This invention provides a data processing method, apparatus, device, and storage medium. It involves determining an interface to be adapted; the interface to be adapted represents an interface whose attribute information changes when a first network model is changed to a second network model. When a target page is detected to be triggered, an encapsulation module is invoked to send a network request to an interface server and obtain return information corresponding to the target interface; the target page is the page that calls the target interface. The target front-end display code is adapted based on the return information and the interface to be adapted; the target front-end display code is the front-end display code corresponding to the target interface. By obtaining the return information of the target interface when accessing the target page and determining whether the front-end display code needs to be adapted based on the return information, the problem of low efficiency is solved by eliminating the need for manual searching and replacing of multiple interfaces repeatedly. Attached Figure Description
[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0038] Figure 1 This is an application scenario diagram of a data processing method provided in an embodiment of the present invention;
[0039] Figure 2 A flowchart illustrating a data processing method provided in an embodiment of the present invention;
[0040] Figure 3 A flowchart illustrating another data processing method provided in an embodiment of the present invention;
[0041] Figure 4 This is a schematic diagram of the structure of a data processing device provided in an embodiment of the present invention;
[0042] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention.
[0043] The accompanying drawings have illustrated specific embodiments of the invention, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the invention in any way, but rather to illustrate the concept of the invention to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0044] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention.
[0045] When the network model is adjusted, the parameters and return values of the API may change, requiring adjustments to the front-end code to adapt. Current techniques typically involve identifying all places that call the API and replacing the original parameters and return values one by one. For each API, this requires finding all places that call it and identifying and replacing the necessary parameters. When there are multiple APIs and multiple products, this process needs to be repeated multiple times, resulting in low efficiency. For example, if the network model changes, affecting 20 APIs and 7 products, 140 APIs need to be processed separately, leading to inefficiency. Here, "products" refers to cloud service providers that utilize the network model, such as load balancers.
[0046] The problem with the above method is that each interface needs to be processed separately. When there are multiple interfaces, repeated searching and replacement are required. Therefore, when the schedule is tight and there are many interfaces and products that need to be modified, the existing method will result in a large workload and take a long time.
[0047] like Figure 1 As shown, based on the above problems, this application adds a processing layer between the interface server and the page. This processing layer sends a request to the interface server to obtain the return information of the target interface when the user accesses the target page, and determines whether the front-end display code needs to be adapted based on the return information. This eliminates the need for manual searching and replacing of multiple interfaces, thus solving the problem of low efficiency and reducing repetitive work. When the target page is triggered, the front-end display code can be adapted automatically.
[0048] Figure 2 This is a flowchart illustrating a data processing method provided in an embodiment of the present invention, the method comprising steps S201 to S203:
[0049] Step S201: Determine the interface to be adapted; the interface to be adapted refers to the interface whose attribute information changes when the first network model is changed to the second network model.
[0050] When the network model changes, some attribute information of certain interfaces will change; these interfaces are those that need to be adapted. Attribute information can refer to the parameters called on the interface and the corresponding return value.
[0051] For example, regarding the VPC list interface, when the network model is changed from the first network model (VLAN) to the second network model (VXLAN), the parameters of this interface under the VLAN network model include networkId, networkName, and networkCidr. Under the VXLAN network model, the parameters of this interface include vpcId (corresponding to the networkId parameter), vpcName (corresponding to the networkName parameter), and vpcCidr (corresponding to the networkCidr parameter). Furthermore, when calling this interface, the return values for networkId, networkName, and networkCidr are all different. Therefore, this VPC list interface is the interface to be adapted.
[0052] Conversely, if every parameter and corresponding return value of an interface remain unchanged when the network model changes, then that interface is not the one to be adapted.
[0053] Therefore, for an interface, obtain the parameters and corresponding return values of the interface under the first network model, and obtain the parameters and return values of the interface under the second network model. When there are different parameters and corresponding return values representing the same content under the two network models, the interface is determined as the interface to be adapted.
[0054] Optionally, the first network model is a VLAN network model; the second network model is a VXLAN network model.
[0055] The first network model and the second network model can be determined according to business needs. When the number of tenants increases, the network needs to provide the ability to isolate a large number of tenants. In this case, the network model needs to be changed from the VLAN network model to the VXLAN network model to meet the business needs.
[0056] Step S202: When the target page is detected to be triggered, the encapsulation module is invoked to send a network request to the interface server and obtain the return information corresponding to the target interface; the target page is the page that calls the target interface.
[0057] The target page is the page that needs to call the target API; that is, the display of the target page needs to be based on the return result of the target API.
[0058] When a target page is detected as being triggered, the encapsulation module can be directly invoked to retrieve the return information of the target interface. For example, this encapsulation module can be implemented by encapsulating a method called `fetchApi`. This encapsulation module is used to initiate a network request to the interface server when any interface is called, so that the interface server, upon receiving the network request, can return the corresponding return information of the target interface.
[0059] For example, the encapsulation module can be called based on the name of the target interface or the address information of the target interface.
[0060] Step S203: Adapt the target front-end display code according to the returned information and the interface to be adapted; the target front-end display code is the front-end display code corresponding to the target interface.
[0061] The returned information indicates the parameters and return values currently used by the target interface. Therefore, it can be determined whether the target front-end display code needs to be adapted based on the returned information.
[0062] Specifically, the returned information can be used to determine whether the target interface is an interface to be adapted. For example, the interfaces to be adapted are interface 1, interface 2 and interface 3. If the target interface is interface 4, it can be determined that the interface is not an interface to be adapted, and there is no need to adapt the corresponding target front-end display code.
[0063] When the network model changes, the parameters and return values of the interface to be adapted may not change immediately; there is a certain effective period. In existing technologies, directly replacing the parameters and return values in the front-end display code corresponding to the interface to be adapted using a find-and-replace method may lead to errors. For example, if the network model is changed from the first network model to the second network model, but the second network model has not yet taken effect, when calling the VPC list interface (the interface to be adapted), the call is still based on the parameters corresponding to the first network model. Therefore, replacing the parameters and return values corresponding to this interface to be adapted will result in an error.
[0064] Based on the above issues, this application, upon determining that the target interface is the interface to be adapted, compares the returned information with the attribute information of the interface to be adapted under the first network model and the attribute information under the second network model to determine whether adaptation of the target front-end display code is necessary. If the returned information is consistent with the attribute information of the interface to be adapted under the first network model, then no adaptation of the front-end display code is required.
[0065] This invention provides a data processing method that, by determining an interface to be adapted (i.e., an interface whose attribute information changes when a first network model is changed to a second network model), and when a target page is detected to be triggered, a wrapper module is invoked to send a network request to an interface server and obtain return information corresponding to the target interface. The target page is the page that calls the target interface. The target front-end display code is adapted based on the return information and the interface to be adapted (i.e., the front-end display code corresponding to the target interface). By obtaining the return information of the target interface when accessing the target page and determining whether the front-end display code needs to be adapted based on the return information, the method eliminates the need for manual searching and replacing of multiple interfaces, thus solving the problem of low efficiency.
[0066] Figure 3 This is a flowchart illustrating another data processing method provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the method includes:
[0067] Step S301: Determine the interface to be adapted; the interface to be adapted refers to the interface whose attribute information changes when the first network model is changed to the second network model.
[0068] The above step S301 can be referred to Figure 2 Step S201 in the illustrated embodiment will not be repeated here.
[0069] Step S302: When the target page is detected to be triggered, determine the address information of the target interface.
[0070] When a target page is detected as being triggered, the target interface corresponding to that target page is determined, and then the address information corresponding to that target interface is determined based on that target interface. For example, the mapping relationship between target interfaces and their corresponding address information can be stored in advance, so that when the target page is detected as being triggered, the address information of the target interface can be obtained directly.
[0071] Step S303: Call the encapsulation module according to the address information of the target interface to obtain the return information corresponding to the target interface.
[0072] When calling the encapsulation module, the address information of the target interface can be input into the encapsulation module, so that the interface server can distinguish the target interface from other interfaces and accurately obtain the return information corresponding to the target interface from the interface server.
[0073] Step S304: Determine whether the address information of the target interface exists in the address array; the address array stores the address information of each of the interfaces to be adapted.
[0074] When determining whether to adapt the target front-end display code, you can first determine whether the target interface is one that needs to be adapted. Specifically, you can pre-obtain the address information of the interfaces to be adapted and store this address information in an address array. For example, if the interfaces to be adapted are interface 1, interface 2, and interface 3, then you can store address information 1 for interface 1, address information 2 for interface 2, and address information 3 for interface 3 in the address array.
[0075] When determining whether a target interface is an interface to be adapted, the address information of the target interface can be directly compared with the address information in the address array. That is, it is determined whether the address information of the target interface exists in the address array, and the result of the comparison determines whether the target interface is an interface to be adapted.
[0076] The target interface is determined to be compatible by comparing address information. There is no need to obtain additional information such as the interface name of the target interface. Moreover, the address information is unique, so it can accurately determine whether the target interface is compatible.
[0077] Step S305: If it exists, determine whether to adapt the target front-end display code based on the returned information and the attribute information corresponding to the interface to be adapted.
[0078] If the address information of the target interface exists in the address array, then the interface can be identified as the interface to be adapted. After identifying the target interface as the interface to be adapted, it is necessary to further determine whether the second network model takes effect after the first network model is changed to the second network model. Specifically, this can be determined based on the returned information and the attribute information corresponding to the interface to be adapted.
[0079] Step S306: If it does not exist, then determine that the target front-end display code will not be adapted.
[0080] If the address information of the target interface does not exist in the address array, it can be determined that the interface is not the interface to be adapted. Therefore, there is no need to adapt the front-end display code of the target interface.
[0081] By first determining whether the target interface is an interface to be adapted, a portion of the interfaces can be filtered out, thereby improving efficiency.
[0082] Optionally, the returned information includes a returned name; determining whether to adapt the target front-end display code based on the returned information and the attribute information corresponding to the interface to be adapted includes:
[0083] For any of the returned names, determine whether the returned name does not belong to the parameters corresponding to the target interface in the first network model but belongs to the parameters corresponding to the target interface in the second network model; if so, adapt the target front-end display code; if not, determine that the target front-end display code should not be adapted.
[0084] The returned information includes a return name, which essentially represents the various parameters currently corresponding to the target interface. For example, when the target interface is a VPC list interface, if the second network model is not yet active, the return name will include networkId, networkName, and networkCidr, indicating that no adaptation of the target front-end display code is required. If the second network model is already active, the return name will include vpcId, vpcName, and vpcCidr, indicating that adaptation of the target front-end display code is necessary. Therefore, based on the return name corresponding to the target interface, it can be determined whether the second network model is active, thereby determining whether adaptation of the target front-end display code is required.
[0085] Specifically, after obtaining the returned name, if the returned name does not belong to the parameters (networkId, networkName, and networkCidr, etc.) corresponding to the target interface in the first network model but belongs to the parameters (vpcId, vpcName, and vpcCidr, etc.) corresponding to the target interface in the second network model, it indicates that the second network model has taken effect and the target front-end display code needs to be adapted. Otherwise, it indicates that the second network model has not taken effect and no adaptation of the target front-end display code is required.
[0086] By comparing the returned name with the parameters of the target interface in the first network model and the parameters of the target interface in the second network model, it can be determined whether the second network model is effective. This avoids the problem of adaptation errors caused by adapting the target front-end display code when the second network model is not effective.
[0087] Optionally, the returned information also includes a return value corresponding to the returned name; adapting the target front-end display code includes:
[0088] Determine the first parameter of the target interface in the parameters corresponding to the return name in the first network model; assign the return value to the first parameter.
[0089] When adapting the target front-end display code, you don't need to modify the front-end display code; you can simply replace the return value. For example, when the target interface is a VPC list interface and the return name is vpcId, the above method can be used to determine that the target front-end display code needs to be adapted.
[0090] When adapting the target front-end display code, since the front-end display code still uses parameters corresponding to the first network model, such as networkId, and there is usually more than one networkId as the first parameter in the front-end code, modifying each of the first parameters in the target front-end display code would result in a large amount of modification. To solve the above problem, this application directly assigns the received return value to the corresponding first parameter, which can achieve adaptation to the network model without modifying the target front-end display code.
[0091] Specifically, before assigning a value, it's necessary to first determine the first parameter of the target interface corresponding to the return name in the parameters of the first network model. The return name and return value are stored as key-value pairs in the return information, indicating a corresponding relationship between them. For example, the return name in the return information might be `vpcId`, and the return value might be a specific ID. Therefore, we can first determine that the parameter corresponding to `vpcId` in the parameters of the first network model for the target interface is `networkId`, which is the first parameter. For a target interface, a mapping table between the parameters of the first network model and the parameters of the second network model can be pre-stored, such as `networkId` corresponding to `vpcId`, `networkName` corresponding to `vpcName`, and `networkCidr` corresponding to `vpcCidr`. By looking up this mapping table based on the return name, the first parameter can be determined.
[0092] Once the first parameter is determined, the return value is directly assigned to the first parameter, so that the front-end display code can display the page based on the received return value.
[0093] The above method allows the front-end page to be displayed correctly without modifying the front-end display code, which has the advantages of minimal modification and high efficiency.
[0094] Optionally, the method further includes:
[0095] After assigning the return value to the first parameter, or after determining that the target front-end display code is not adapted, the return value is returned to the target front-end display code for page display.
[0096] After reassigning a value to the first parameter, the return value needs to be returned to the target front-end display code for page display. Alternatively, if the code is not adapted to the target front-end display code, the return value can be directly returned to the target front-end display code for page display.
[0097] This application adds a layer between the page and the interface server. It can determine whether to adapt the front-end display code corresponding to the target interface based on the return information sent by the interface server. When triggered on the target page, the front-end display code can be adapted without having to find out where each interface to be adapted is called, thus avoiding omissions in the modification.
[0098] Figure 4 This is a schematic diagram of a data processing apparatus provided in an embodiment of the present invention. The apparatus 40 includes:
[0099] The determination module 401 is used to determine the interface to be adapted; the interface to be adapted refers to the interface whose attribute information changes when the first network model is changed to the second network model;
[0100] The calling module 402 is used to call the encapsulation module to send a network request to the interface server and obtain the return information corresponding to the target interface when the target page is detected to be triggered; the target page is the page that calls the target interface;
[0101] The adaptation module 403 is used to adapt the target front-end display code according to the returned information and the interface to be adapted; the target front-end display code is the front-end display code corresponding to the target interface.
[0102] Optionally, the calling module 402 is specifically used for:
[0103] Determine the address information of the target interface;
[0104] The encapsulation module is invoked based on the address information of the target interface to obtain the return information corresponding to the target interface.
[0105] Optionally, the adapter module 403 is specifically used for:
[0106] Determine whether the address information of the target interface exists in the address array; the address array stores the address information of each of the interfaces to be adapted.
[0107] If it exists, then determine whether to adapt the target front-end display code based on the returned information and the attribute information corresponding to the interface to be adapted;
[0108] If it does not exist, then it is determined that the target front-end display code will not be adapted.
[0109] Optionally, when the adaptation module 403 determines whether to adapt the target front-end display code based on the returned information and the attribute information corresponding to the interface to be adapted, it is specifically used for:
[0110] For any of the returned names, determine whether the returned name does not belong to the parameter corresponding to the target interface in the first network model but belongs to the parameter corresponding to the target interface in the second network model;
[0111] If so, then the target front-end display code will be adapted;
[0112] If not, then it is determined that the target front-end display code will not be adapted.
[0113] Optionally, the returned information also includes a return value corresponding to the returned name; when adapting the target front-end display code, the adaptation module 403 is specifically used for:
[0114] Determine the first parameter of the target interface that corresponds to the returned name in the parameters corresponding to the first network model;
[0115] The return value is assigned to the first parameter.
[0116] Optionally, the device further includes a return module, specifically used for:
[0117] After assigning the return value to the first parameter, or after determining that the target front-end display code is not adapted, the return value is returned to the target front-end display code for page display.
[0118] Optionally, the first network model is a VLAN network model; the second network model is a VXLAN network model.
[0119] The data processing apparatus provided in this embodiment of the invention can achieve the above-mentioned... Figure 2 and Figure 3 The data processing method of the embodiment shown is similar in principle and technical effect, and will not be described again here.
[0120] Figure 5 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present invention. Figure 5 As shown, the electronic device provided in this embodiment includes at least one processor 501 and a memory 502. The processor 501 and the memory 502 are connected via a bus 503.
[0121] In a specific implementation, at least one processor 501 executes computer execution instructions stored in memory 502, causing at least one processor 501 to execute the method in the above method embodiment.
[0122] The specific implementation process of processor 501 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0123] In the above Figure 5 In the illustrated embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0124] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage.
[0125] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0126] This invention also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method described in the above embodiments.
[0127] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the method described in the above method embodiments.
[0128] The aforementioned computer-readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.
[0129] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.
[0130] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0131] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0133] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A data processing method, characterized in that, The method includes: Identify the interfaces to be adapted; the interfaces to be adapted refer to those whose attribute information changes when the first network model is changed to the second network model. When a target page is detected to be triggered, the encapsulation module is invoked to send a network request to the interface server and obtain the return information corresponding to the target interface; the target page is the page that calls the target interface; the return information includes a return name and a return value corresponding to the return name; Determine whether the address information of the target interface exists in the address array; the address array stores the address information of each of the interfaces to be adapted. If it exists, for any of the returned names, determine whether the returned name does not belong to the parameter corresponding to the target interface in the first network model but belongs to the parameter corresponding to the target interface in the second network model; if yes, adapt the target front-end display code; if no, determine that the target front-end display code should not be adapted. If it does not exist, then it is determined that the target front-end display code will not be adapted; Wherein, the target front-end display code is the front-end display code corresponding to the target interface; Adapting the target front-end display code includes: Determine the first parameter of the target interface that corresponds to the returned name in the parameters corresponding to the first network model; The return value is assigned to the first parameter.
2. The method according to claim 1, characterized in that, The encapsulation module is invoked to send a network request to the interface server and obtain the return information corresponding to the target interface, including: Determine the address information of the target interface; The encapsulation module is invoked based on the address information of the target interface to obtain the return information corresponding to the target interface.
3. The method according to claim 1, characterized in that, The method further includes: After assigning the return value to the first parameter, or after determining that the target front-end display code is not adapted, the return value is returned to the target front-end display code for page display.
4. The method according to any one of claims 1-3, characterized in that, The first network model is a VLAN network model; the second network model is a VXLAN network model.
5. A data processing apparatus, characterized in that, The device includes: The determination module is used to determine the interface to be adapted; the interface to be adapted refers to the interface whose attribute information changes when the first network model is changed to the second network model; The calling module is used to call the encapsulation module to send a network request to the interface server and obtain the return information corresponding to the target interface when the target page is detected to be triggered; the target page is the page that calls the target interface; the return information includes a return name and a return value corresponding to the return name; An adaptation module is used to determine whether the address information of the target interface exists in an address array; the address array stores the address information of each of the interfaces to be adapted; if it exists, for any returned name, it is determined whether the returned name does not belong to the parameter corresponding to the target interface in the first network model but belongs to the parameter corresponding to the target interface in the second network model; if so, the target front-end display code is adapted; if not, it is determined that the target front-end display code is not adapted; if it does not exist, it is determined that the target front-end display code is not adapted; wherein, the target front-end display code is the front-end display code corresponding to the target interface; adapting the target front-end display code includes: determining the first parameter corresponding to the returned name in the parameters corresponding to the target interface in the first network model; and assigning the returned value to the first parameter.
6. An electronic device, characterized in that, include: At least one processor and memory; The memory stores computer-executed instructions; The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the method as described in any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, implement the method as described in any one of claims 1 to 4.
8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, is used to implement the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Method for calling configuration interface, and related device
CN108683550A
Network configuration issuing method and device
CN113472563A
Interface configuration method and device, computer equipment and storage medium
CN113900725A