Data processing method, electronic equipment and computer storage medium
By providing a code parameter configuration interface in the CDN scenario, users can customize and set the running parameters of the edge program ER function code, solving the problem that developers need to understand ER functions and syntax, and implementing the ability to quickly access ER, improving development efficiency and reducing costs.
Patent Information
- Application Number
- CN202510009201.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-02
- Publication Date
- 2025-04-25
AI Technical Summary
In the CDN scenario, when developers need to access edge programs (ER) capabilities, they need to understand the functions and syntax of ER in advance, which is costly to learn, and complex testing links are required after code development, resulting in low development efficiency and high cost.
Provide a data processing method, which allows users to customize the operation parameter configuration data of edge program ER function code by displaying the code parameter configuration interface, and then runs the general ER function code in the edge node of the content distribution network to execute user-defined personalized edge program processing logic.
The ability to convert the ER function code implementation capabilities into parameter configurations does not need to care about the specific development process and logic implementation. The ER capability can be quickly accessed through simple parameter configuration operations, which improves development efficiency and reduces development costs.
Smart Images

Figure CN119884522A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a data processing method, an electronic device, a computer storage medium, and a computer program product. Background Art
[0002] CDN (Content Delivery Network) is a distributed network built on top of the bearer network and consists of edge node server clusters spread across different regions. CDN works by caching content copies on edge servers in multiple different regions. When a user requests content, it automatically redirects the request to the nearest edge server, thereby reducing latency and increasing loading speed.
[0003] Edge Routine (ER) is a computing environment that runs on edge servers without the need to manage servers. For CDN scenarios, users can develop JavaScript ER code by themselves. Once the ER code is uploaded, the deployment of global CDN nodes can be completed and executed at the global edge. User requests from all over the world can be processed in a personalized manner according to the ER code logic developed by the user.
[0004] For ordinary developers, if they want to access ER capabilities, they need to know the functions that ER can achieve and the related syntax program codes in advance, which has a high learning cost. In addition, to ensure operational stability, the code must go through complex testing after it is developed and launched. Therefore, the development efficiency is low and the cost is high. Summary of the invention
[0005] In view of this, embodiments of the present application provide a data processing method, an electronic device, a computer storage medium, and a computer program product.
[0006] According to a first aspect of an embodiment of the present application, a data processing method is provided, which is applied to a client device, and the method includes:
[0007] Displaying a code parameter configuration interface, wherein the code parameter configuration interface is used to configure code running parameters for the pre-developed edge program ER function code;
[0008] In response to the parameter configuration operation in the code parameter configuration interface, ER code configuration data is generated to run the ER function code in an edge node in a content distribution network based on the ER code configuration data.
[0009] According to a second aspect of an embodiment of the present application, another data processing method is provided, which is applied to an edge node in a content distribution network, wherein an edge program and a pre-developed edge program ER function code are deployed in the edge node, and the method includes:
[0010] receiving a user request through the edge program;
[0011] Parsing the user request to obtain identification information contained in the user request, wherein the identification information is identification information corresponding to the ER code configuration data; the ER code configuration data is generated by the method described in the first aspect;
[0012] Determine target ER code configuration data from a pre-built configuration database according to the identification information;
[0013] The ER function code is run based on the target ER code configuration data, a request response result is obtained, and the request response result is returned.
[0014] According to the third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method described in the first aspect.
[0015] According to a fourth aspect of an embodiment of the present application, a computer storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described in the first aspect is implemented.
[0016] The data processing solution provided in the embodiment of the present application pre-develops a general ER function code, and then displays a code parameter configuration interface for configuring code running parameters for the developed ER function code to the user through a client device, so that the user can customize the ER code configuration data corresponding to the ER function code in the code parameter configuration interface; in the subsequent process, the general ER function code can be run based on the ER code configuration data, so that the edge node in the content distribution network can execute the user-defined personalized edge program processing logic.
[0017] The above-mentioned embodiment of the present application converts the ER function code implementation capability into the parameter configuration capability. The user does not need to care about the specific development process and logical implementation of the ER function code, nor does he need to spend a lot of time on code verification. Instead, he can quickly access the ER capability through simple parameter configuration operations in the code parameter configuration interface. Therefore, the development efficiency is improved and the development cost is reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0019] Figure 1 is a flowchart of a data processing method according to an embodiment of the present application;
[0020] Figure 2 for Figure 1 A schematic diagram of an example scenario in the illustrated embodiment;
[0021] Figure 3 is a flowchart of another data processing method according to an embodiment of the present application;
[0022] Figure 4 for Figure 3 A schematic diagram of an example scenario in the illustrated embodiment;
[0023] Figure 5 is a structural block diagram of a data processing device according to an embodiment of the present application;
[0024] Figure 6 is a structural block diagram of another data processing device according to an embodiment of the present application;
[0025] Figure 7 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the embodiments of the present application should fall within the scope of protection of the embodiments of the present application.
[0027] Reference Figure 1 , Figure 1 The data processing method provided in the embodiment of the present application can be applied to a client device, and the specific method may include the following steps:
[0028] Step 102, displaying a code parameter configuration interface, where the code parameter configuration interface is used to configure code running parameters for the pre-developed edge program ER function code.
[0029] Specifically, the pre-developed edge program ER function code in the embodiment of the present application may refer to: when the edge node in the content distribution network runs the code in the edge program, the code can execute the preset processing logic and provide the preset service function.
[0030] ER function codes can be written and packaged in advance according to the user's personalized processing needs, so as to obtain modular ER function codes for implementing certain functions. For example, functional analysis and statistics can be performed on the codes written by users and deployed to edge programs in the historical period, so as to determine a variety of different functions to be developed. In addition, when determining the functions to be developed, the functions that are generally involved in the service implementation process can also be included in the list of functions to be developed based on the development experience of developers; then, code development is carried out for each function to be developed, so as to obtain the ER function code in this step.
[0031] Before the code is run, it is usually necessary to configure the running parameters so that the code running process can execute the corresponding processing logic according to the configured parameters. In the embodiment of the present application, a code parameter configuration interface for configuring the code running parameters for each ER function code is displayed to the user through the client device, so that the user can configure the code running parameters for the ER function code in the interface.
[0032] Step 104 , in response to the parameter configuration operation in the code parameter configuration interface, ER code configuration data is generated to run the ER function code in the edge node in the content distribution network based on the ER code configuration data.
[0033] Specifically, after the client device displays the code parameter configuration interface to the user, the user can pass the configuration data corresponding to the ER function code to the client device through the parameter configuration operation in the interface. The above-mentioned parameter configuration operation can be customized according to the actual situation. In the embodiment of the present application, the specific form of the parameter configuration operation is not limited. For example: a data input box can be displayed to the user. When the user performs a data input operation in the data input box, it is determined that the user has performed a parameter configuration operation, and the input entered by the user is determined as configuration data; components such as virtual icons corresponding to different configuration data can also be displayed to the user. When the user interacts with the above-mentioned components, it is determined that the user has performed a parameter configuration operation, and the configuration data is determined based on the preset meaning represented by each component; an audio input component can also be displayed to the user. When the user clicks on the component, it is determined that the user has performed a parameter configuration operation. At this time, the user's voice data can be detected, and the configuration data can be extracted from the voice data, and so on.
[0034] In the embodiment of the present application, each edge node in the content distribution network is deployed with an edge program and the above-mentioned pre-developed ER function code. After the ER code configuration data is generated through the above steps 102 and 104, the above-mentioned ER function code deployed can be run in the edge program of each edge node according to the generated ER code configuration data, thereby executing the processing logic corresponding to the user's ER code configuration data and providing the corresponding service function.
[0035] The data processing solution provided in the embodiment of the present application pre-develops a general ER function code, and then displays a code parameter configuration interface for configuring code running parameters for the developed ER function code to the user through a client device, so that the user can customize the ER code configuration data corresponding to the ER function code in the code parameter configuration interface; in the subsequent process, the general ER function code can be run based on the ER code configuration data, so that the edge node in the content distribution network can execute the user-defined personalized edge program processing logic.
[0036] In the above embodiment of the present application, the ER function code realization capability is converted into the parameter configuration capability. The user does not need to care about the specific development process and logic implementation of the ER function code, nor does he need to spend a lot of time to verify the code. Instead, he can quickly access the ER capability through simple parameter configuration operations in the code parameter configuration interface. Therefore, the development efficiency is improved and the development cost is reduced.
[0037] Optionally, in some of the embodiments, the number of pre-developed ER function codes is multiple, and multiple ER function code icons are displayed in the code parameter configuration interface; the ER function code icons correspond to the ER function codes one by one;
[0038] In response to the parameter configuration operation in the code parameter configuration interface, the configuration data of the ER code is generated, including:
[0039] In response to a selection operation of an ER function code icon in the code parameter configuration interface, a parameter configuration sub-interface corresponding to the selected ER function code icon is displayed;
[0040] Generate configuration data for the selected ER function code based on the code parameter information set in the parameter configuration sub-interface;
[0041] Combine the configuration data of the selected ER function code to generate ER code configuration data.
[0042] Specifically, a variety of more general ER function codes for implementing different functions can be developed in advance. Exemplarily, ER cache codes for implementing data cache functions, ER bucketing codes for implementing data bucketing functions, ER redirection codes for implementing request redirection functions, ER rendering codes for implementing data rendering functions, and so on can be developed. Correspondingly, in the code parameter configuration interface, an ER function code icon can be set for each ER function code. In the embodiment of the present application, the specific form of the ER function code icon is not limited, and can be customized according to actual conditions, for example: it can be set in the form of a button component, it can also be set in the form of a menu key component, and so on.
[0043] When the user wants to configure code parameters for a ER function code, the user can first select the ER function code icon corresponding to the ER function code in the interface, so that the client device further displays the parameter configuration sub-interface for configuring the ER function code parameters to the user. Afterwards, the user can set the code parameter information in the parameter configuration sub-interface to generate the configuration data of the ER function code.
[0044] Furthermore, in some scenarios, the functions that the user wants to implement may be relatively complex. In this case, through the solution provided by the above embodiment of the present application, the above complex functions can be split into a combination of multiple general ER function codes, and configuration data can be generated for each general ER function code respectively, and then the configuration data corresponding to each general ER function code can be combined to obtain the complete ER code configuration data corresponding to the above complex functions.
[0045] In the above embodiment of the present application, by combining multiple ER function codes, the development process of complex functions is simplified to a process of sequentially configuring code parameters of multiple existing function codes and combining configuration data. Therefore, the code development efficiency can be further improved and the development cost can be reduced.
[0046] Optionally, in some of the embodiments, the above combination has selected the configuration data of the ER function code, and the process of generating the ER code configuration data can be specifically implemented as follows:
[0047] The configuration data of each selected ER function code is combined in the order of selection of each selected ER function code icon, and the ER code configuration data is generated.
[0048] Specifically, the user can select the corresponding ER function code icons and set the code parameter information in sequence according to the execution order of each ER function code in the actual operation process, so that the client device generates configuration data for each selected ER function code (the ER function code corresponding to the selected ER function code icon), and then uses the configuration data generated for each selected ER function code as a code configuration data fragment, and combines the above code configuration data fragments according to the selection order of the ER function code icons to obtain the configuration data corresponding to the complex function code, so as to realize the above complex function based on the configuration data.
[0049] In the above combination method for the configuration data of the selected ER function code, the combination order of each configuration data is clearly specified by the user through the selection method, and the order selected by the user can reflect the order of the combination. For the user, this method is more intuitive, easy to understand and operate. In addition, when the user configures the parameters of each ER function code, the user can see the order of the combination, which is convenient for timely adjustment of the wrong combination.
[0050] Optionally, in some other embodiments, a combination relationship icon may also be displayed in the code parameter configuration interface. In this case, the above combination has selected the configuration data of the ER function code, and the process of generating the ER code configuration data may be specifically implemented as follows:
[0051] In response to a triggering operation on a combination relationship icon displayed in a code parameter configuration interface, determining a combination relationship between each selected ER function code icon;
[0052] According to the combination relationship between the selected ER function code icons, the configuration data of the selected ER function codes are combined to generate the ER code configuration data.
[0053] Specifically, combination relationship icons are also displayed in the code parameter configuration interface. For example, they may include a series relationship icon for representing the sequential connection of two configuration data, a parallel relationship icon for representing the parallel execution of two configuration data, a selection relationship icon for representing the selection of one of the two configuration data to be executed, and so on.
[0054] After the user generates corresponding configuration data for each selected ER function code, the combination relationship between the ER function code icons can be determined by triggering the above-mentioned combination relationship icons, and then the configuration data can be combined according to the combination relationship to generate the final complete ER code configuration data.
[0055] In the above embodiment of the present application, by setting a combination relationship icon, the process of generating configuration data for each ER function code and the process of combining each configuration data are decoupled, thereby avoiding mutual interference between different processes, so that users can perform the above processes more attentively. In addition, after generating the configuration data, the user can flexibly adjust the combination order between the configuration data according to needs, and the above implementation method has higher flexibility.
[0056] Optionally, in some of the embodiments, the data processing method may further include:
[0057] Display the code editing interface, which contains multiple code editing icons, where the code editing icons correspond to ER function codes one by one;
[0058] In response to a selection operation of a target code editing icon in the code editing interface, obtaining and displaying a target ER function code corresponding to the target code editing icon;
[0059] According to the modification operation on the target ER function code, a modified ER function code is generated, so as to replace the target ER function code pre-deployed to the edge node in the content distribution network with the modified ER function code.
[0060] Specifically, program code updates and iterations are usually fast, and, in the actual request processing process, even for the same general ER function, different users may have different customization requirements in terms of specific implementation details.
[0061] Taking the above considerations into consideration, the embodiment of the present application also provides the user with a code editing function, so that the user can locally modify and edit the ER function code that has been written, so that when the edge node executes the modified ER function code, it can better meet the user's customization needs and improve the user's experience.
[0062] In addition, through the above code editing function, the user can obtain customized code that meets his own needs by modifying the local details of the target ER function code while keeping the main implementation logic of the target ER function code unchanged. Compared with the method that relies on the user to write the complete code, the above embodiment of the present application can better ensure the feasibility and stability of the final modified ER function code.
[0063] Optionally, in some of the embodiments, after generating the ER code configuration data, the data processing method may further include: generating identification information for the ER code configuration data, and storing the ER code configuration data based on the identification information.
[0064] Specifically, with respect to edge programs running in edge nodes in a content distribution network, there may be a large number of users, and the ER code configuration data of different users are usually different. Therefore, in order to facilitate management and avoid confusion between ER code configuration data of different users, and also to quickly determine the corresponding ER code configuration data during the code running phase, in the above embodiment of the present application, after the ER code configuration data is generated during the parameter configuration phase, corresponding identification information is generated for the configuration data, and then the generated ER code configuration data is stored according to the identification information.
[0065] Optionally, in some of the embodiments, after generating identification information for the ER code configuration data, the data processing method may further include:
[0066] Receive the code running environment information set for the ER code configuration data input by the user;
[0067] Stores ER code configuration data based on identification information, including:
[0068] Store ER code configuration data based on identification information and code running environment information.
[0069] Specifically, during the process of code development and deployment, different operating environments are usually set up according to different development stages, and code parameter information is usually different in different operating environments. Specifically, the code operating environment can usually include: test environment, grayscale environment and production environment. Among them, the test environment is used in the testing phase of the code development process. In this environment, developers usually write and execute test cases to verify whether the functions of the code meet the design requirements and check whether there are defects or errors in the code; the grayscale environment is an environment used for stage testing before the code is officially released. It simulates the production environment and is usually open to some users for testing the performance and stability of the new version; the production environment is the environment where the code actually runs. It is a fully configured, stable, secure, and tested environment.
[0070] Therefore, for the same project (that is, for the same code function that the user wants to implement), in the embodiment of the present application, when storing the ER code configuration data, the current code running environment is also taken into consideration, and then the ER code configuration data is stored according to the two dimensions of identification information dimension and running environment dimension.
[0071] In the embodiment of the present application, when storing ER code configuration data, both the code function and the code running environment are taken into consideration, that is, storage index information is generated for the ER code configuration data based on both the code function and the code running environment. In this way, in the actual operation stage, the target ER code configuration data can be retrieved from the configuration database based on the information of the above two dimensions at the same time, thereby improving the efficiency of obtaining the target ER code configuration data and also improving the accuracy of obtaining the target ER code configuration data.
[0072] Optionally, in some of the embodiments, the process of storing the ER code configuration data based on the identification information may include: storing the ER code configuration data in each edge node in the content distribution network based on the identification information.
[0073] Specifically, each edge node is deployed with an edge program and a pre-developed ER function code. When each edge node runs the ER function code through the edge program, it must be based on the corresponding ER code configuration data. When the ER code configuration data is stored in the embodiment of the present application, the data is stored in the local area of each edge node. In this way, when each edge node runs the ER function code through the edge program, the corresponding ER code configuration data can be quickly obtained, thereby effectively improving the efficiency of request response.
[0074] Optionally, in some of the embodiments, the pre-developed edge program ER function code includes: a service function code and a service monitoring function code; the service monitoring function code is used to perform service anomaly monitoring during the process of running the service function code at the edge node in the content distribution network.
[0075] Specifically, in the above-mentioned embodiment of the present application, the pre-developed ER function code includes a service monitoring function code. Through the operation of this code, the service anomalies during the operation of other service function codes can be monitored, and an abnormal alarm can be issued when an abnormality is detected. By pre-uniformly developing and deploying the service monitoring function code, during the code operation, the embodiment of the present application can uniformly monitor the service function code from the bottom layer, that is, it can uniformly access the abnormal monitoring and alarm capabilities for different users without the need for users to additionally develop and configure the abnormal monitoring function, which can provide a guarantee for the stable implementation of the service function at a relatively low development cost.
[0076] See also Figure 2 , Figure 2 for Figure 1 A schematic diagram of an example scenario in the embodiment shown. Figure 2 The specific implementation process of the above embodiment of the present application is briefly described:
[0077] When the user wants to obtain the ER function code for executing a customized personalized edge program processing logic, he can add the project operation in the display interface of the client device. Specifically, he can perform parameter configuration operation in the code parameter configuration interface displayed by the client device to generate ER code configuration data, that is, configure ER capabilities. Figure 2 , Figure 2 The ER capabilities (pre-developed edge program ER function codes) provided by the embodiments of the present application are exemplarily demonstrated in the figure: ER caching code for implementing data caching function, ER bucketing code for implementing data bucketing function, ER rendering code for implementing data rendering function, ER timeout processing code for processing timeout requests, and so on.
[0078] After the client completes the parameter configuration operation, the client device may generate identification information for the generated ER code configuration data, and save the ER code configuration data based on the identification information. Furthermore, corresponding code running environment information (such as Figure 2 Exemplarily, test environment, grayscale environment, production environment).
[0079] Reference Figure 3 , Figure 3 The data processing method provided in the embodiment of the present application can be applied to edge nodes in a content distribution network, where edge programs and pre-developed edge program ER function codes are deployed. The data processing method can specifically include the following steps:
[0080] Step 302: Receive a user request through an edge program.
[0081] Specifically, the user request may be sent by a client device in communication with the content distribution network to an edge node in the content distribution network. In the embodiment of the present application, the specific content of the user request is not limited and can be customized according to actual needs.
[0082] Step 304, parsing the user request to obtain identification information contained in the user request, where the identification information is identification information corresponding to the ER code configuration data.
[0083] Among them, ER code configuration data is passed as follows Figure 1 The data processing method provided by the illustrated embodiment is generated.
[0084] Specifically, the user request of the embodiment of the present application may include identification information corresponding to the ER code configuration data. After the edge program receives the request, it can obtain the identification information by parsing the request.
[0085] Step 306: Determine the target ER code configuration data from a pre-built configuration database according to the identification information.
[0086] Specifically, the pre-built configuration database stores ER code configuration data, and the ER code configuration data is obtained by Figure 1 The data processing method provided by the illustrated embodiment is generated.
[0087] After receiving the user request, the identification information corresponding to the ER code configuration data can be parsed from the user request, and then the target ER code configuration data can be determined from the configuration database according to the identification information.
[0088] Step 308, running the ER function code based on the target ER code configuration data, obtaining the request response result, and returning the request response result.
[0089] Specifically, in the embodiment of the present application, each edge node in the content distribution network is deployed with an edge program and the above-mentioned pre-developed ER function code. After the target ER code configuration data is determined through the above step 308, the above-mentioned ER function code deployed can be run in the edge program of the edge node according to the target ER code configuration data, thereby executing the processing logic corresponding to the user's ER code configuration data, obtaining the request response data and returning it to the user.
[0090] The data processing solution provided in the embodiment of the present application pre-develops a general ER function code, and then displays a code parameter configuration interface for configuring code running parameters for the developed ER function code to the user through a client device, so that the user can customize the ER code configuration data corresponding to the ER function code in the code parameter configuration interface; in the subsequent process, the general ER function code can be run based on the ER code configuration data, so that the edge node in the content distribution network can execute the user-defined personalized edge program processing logic.
[0091] The above-mentioned embodiment of the present application converts the ER function code implementation capability into the parameter configuration capability. The user does not need to care about the specific development process and logical implementation of the ER function code, nor does he need to spend a lot of time on code verification. Instead, he can quickly access the ER capability through simple parameter configuration operations in the code parameter configuration interface. Therefore, the development efficiency is improved and the development cost is reduced.
[0092] Optionally, in some of the embodiments, the number of pre-developed ER function codes is multiple, the target ER code configuration data includes multiple code configuration data segments, and the multiple code configuration data segments have a preset sequence; one code configuration data segment corresponds to one ER function code;
[0093] Run the ER function code based on the target ER code configuration data to obtain the request response results, including:
[0094] Based on multiple code configuration data fragments included in the target ER code configuration data and a preset sequence between the multiple code configuration data fragments, multiple pre-developed ER function codes are run in sequence to obtain a request response result.
[0095] Specifically, a variety of relatively common ER function codes for implementing different functions can be developed in advance. For example, ER cache code for implementing data cache function, ER bucketing code for implementing data bucketing function, ER redirection code for implementing request redirection function, ER rendering code for implementing data rendering function, etc. can be developed. Correspondingly, when generating code configuration data, a corresponding configuration data is generated for each ER function code, and then the configuration data corresponding to each ER function code is used as a code configuration data fragment, and combined according to the order of configuration, so as to obtain the ER code configuration data corresponding to the complex function code.
[0096] Accordingly, in the specific application stage, after the above-mentioned complex target ER code configuration data is determined, each ER function code can be run in sequence according to each code configuration data fragment contained therein, as well as the sequence between each code configuration data fragment (determined according to the sequence selected by the user configuration), so as to obtain the final request response result.
[0097] In an embodiment of the present application, by combining multiple ER function codes, the development process of complex functions is simplified to a process of sequentially configuring code parameters for multiple existing function codes and combining configuration data. Therefore, the code development efficiency can be further improved and the development cost can be reduced.
[0098] Optionally, in some of the embodiments, the process of parsing the user request and obtaining the identification information contained in the user request may include:
[0099] Parse the user request and obtain the identification information and code running environment information contained in the user request;
[0100] Based on the identification information, the target ER code configuration data is determined from the pre-built configuration database, including:
[0101] Determine multiple candidate ER code configuration data from a pre-built configuration database according to the identification information;
[0102] According to the code running environment information, target ER code configuration data is determined from a plurality of candidate ER code configuration data.
[0103] Specifically, in the process of code development, deployment and operation, different operating environments are usually set according to different stages, and code parameter information is usually different in different operating environments. Specifically, the code operating environment can usually include: test environment, grayscale environment and production environment. Among them, the test environment is used in the testing phase of the code development process. In this environment, developers usually write and execute test cases to verify whether the functions of the code meet the design requirements and check whether there are defects or errors in the code; the grayscale environment is an environment used for stage testing before the code is officially released. It simulates the production environment and is usually open to some users for testing the performance and stability of the new version; the production environment is the environment where the code actually runs. It is a fully configured, stable, secure, and tested environment.
[0104] Therefore, for the same project (that is, for the same code function that the user wants to implement), in the embodiment of the present application, when storing the ER code configuration data, the current code running environment is also taken into consideration, and then the ER code configuration data is stored according to the two dimensions of identification information dimension and running environment dimension.
[0105] In the embodiment of the present application, when storing ER code configuration data, both the code function and the code running environment are taken into consideration, that is, storage index information is generated for the ER code configuration data based on both the code function and the code running environment. In this way, in the actual operation stage, the target ER code configuration data can be retrieved from the configuration database based on the information of the above two dimensions at the same time, thereby improving the efficiency of obtaining the target ER code configuration data and also improving the accuracy of obtaining the target ER code configuration data.
[0106] Optionally, in some of the embodiments, parsing the user request to obtain identification information and code running environment information contained in the user request includes:
[0107] According to the path field in the user request, the identification information contained in the user request is parsed; according to the domain name field in the user request, the code running environment information contained in the user request is parsed.
[0108] Specifically, different operating environments can be distinguished by the domain name field in the request, which can effectively isolate user requests from different environments to avoid mutual interference. Including identification information and environment information in the path and domain name fields respectively can simplify request parsing and quickly filter and identify specific environments and specific identification information.
[0109] Optionally, in some of the embodiments, the pre-developed ER function code includes: a service function code and a service monitoring function code;
[0110] Run the ER function code based on the target ER code configuration data, obtain the request response result, and return the request response result, including:
[0111] Run the service function code based on the target ER code configuration data, obtain the request response result, and return the request response result;
[0112] During the operation of the service function code, the service monitoring function code is run in parallel based on the target ER code configuration data to monitor the abnormal operation of the service function code and output abnormal alarm information when abnormal operation of the service function code is detected.
[0113] Specifically, in the above-mentioned embodiment of the present application, the pre-developed ER function code includes a service monitoring function code. Through the operation of this code, the service anomalies during the operation of other service function codes can be monitored, and an abnormal alarm can be issued when an abnormality is detected. By pre-uniformly developing and deploying the service monitoring function code, during the code operation, the embodiment of the present application can uniformly monitor the service function code from the bottom layer, that is, it can uniformly access the abnormal monitoring and alarm capabilities for different users without the need for users to additionally develop and configure the abnormal monitoring function, which can provide a guarantee for the stable implementation of the service function at a relatively low development cost.
[0114] Optionally, in some of the embodiments, before running the ER function code based on the target ER code configuration data, the data processing method may further include:
[0115] receiving a modified ER function code sent by a client device, where the modified ER function code is a code obtained by modifying the ER function code deployed to the edge node; and replacing the ER function code with the modified ER function code;
[0116] Correspondingly, the ER function code is run based on the target ER code configuration data, including:
[0117] The modified ER function is parameterized according to the target ER code configuration data, and the parameterized modified ER function is run.
[0118] Specifically, considering that program code updates and iterations are usually fast, and in the actual request processing process, even for the same general ER function, different users may have different customization requirements in the specific implementation details. Considering the above aspects, the embodiment of the present application also provides the user with a code editing function, allowing the user to modify and edit the ER function code that has been written, so that the edge node executes the modified ER function code after receiving the user request, thereby obtaining a request response result that better meets the user's needs, thereby improving the user's experience.
[0119] In addition, through the above code editing function, the user can obtain customized code that meets his own needs by modifying the local details of the target ER function code while keeping the main implementation logic of the target ER function code unchanged. Compared with the method that relies on the user to write the complete code, the above embodiment of the present application can better ensure the feasibility and stability of the final modified ER function code.
[0120] See also Figure 4 , Figure 4 for Figure 3 A schematic diagram of an example scenario in the embodiment shown. Figure 4 Regarding this application Figure 3 The specific implementation process of the embodiment shown is briefly described:
[0121] The edge node in the content distribution network receives the user request through the edge program; parses the user request to obtain the identification information contained in the user request (i.e. Figure 4 Further, the code running environment information contained in the user request is obtained by parsing the user request (that is, Figure 4 parsing environment in ); according to the identification information obtained by parsing and the code running environment information (such as Figure 4 Exemplarily: test environment, grayscale environment, production environment), obtain target ER code configuration data from the configuration database; then execute the ER function code according to the target ER code configuration data to obtain the request response result.
[0122] Figure 5 The data processing device provided by the embodiment of the present application is located in a client device, and the data processing device may include:
[0123] An interface display module 502 is used to display a code parameter configuration interface, where the code parameter configuration interface is used to configure code running parameters for the pre-developed edge program ER function code;
[0124] The data generation module 504 is used to generate ER code configuration data in response to the parameter configuration operation in the code parameter configuration interface, so as to run the ER function code in the edge node in the content distribution network based on the ER code configuration data.
[0125] Optionally, in some of the embodiments, the number of pre-developed ER function codes is multiple, and multiple ER function code icons are displayed in the code parameter configuration interface; the ER function code icons correspond to the ER function codes one by one;
[0126] The data generation module 502, when executing the step of generating ER code configuration data in response to the parameter configuration operation in the code parameter configuration interface, is specifically used to:
[0127] In response to a selection operation of an ER function code icon in the code parameter configuration interface, a parameter configuration sub-interface corresponding to the selected ER function code icon is displayed;
[0128] Generate configuration data for the selected ER function code based on the code parameter information set in the parameter configuration sub-interface;
[0129] Combine the configuration data of the selected ER function code to generate ER code configuration data.
[0130] Optionally, in some of the embodiments, the data generation module 502, when executing the step of combining the configuration data of the selected ER function code to generate the ER code configuration data, is specifically configured to:
[0131] The configuration data of each selected ER function code is combined in the order of selection of each selected ER function code icon, and the ER code configuration data is generated.
[0132] Optionally, in some of the embodiments, a combination relationship icon is also displayed in the code parameter configuration interface; according to the generation module 502, when executing the step of combining the configuration data of the selected ER function code to generate the ER code configuration data, it is specifically used to:
[0133] In response to a triggering operation on a combination relationship icon displayed in the code parameter configuration interface, determining a combination relationship between each selected ER function code icon;
[0134] According to the combination relationship between the selected ER function code icons, the configuration data of the selected ER function codes are combined to generate the ER code configuration data.
[0135] Optionally, in some of the embodiments, the data processing device may further include:
[0136] The code editing module is used to display a code editing interface, wherein the code editing interface includes a plurality of code editing icons, wherein the code editing icons correspond to the ER function codes one by one; in response to a selection operation of a target code editing icon in the code editing interface, a target ER function code corresponding to the target code editing icon is acquired and displayed; and according to a modification operation of the target ER function code, a modified ER function code is generated, so as to replace the target ER function code pre-deployed to an edge node in a content distribution network with the modified ER function code.
[0137] Optionally, in some of the embodiments, the data generation module 502, after executing the step of generating ER code configuration data, is further configured to:
[0138] Identification information is generated for the ER code configuration data, and the ER code configuration data is stored based on the identification information.
[0139] Optionally, in some of the embodiments, the data generation module 502, after executing the step of generating identification information for the ER code configuration data, is further configured to:
[0140] Receive the code running environment information set for the ER code configuration data input by the user;
[0141] Correspondingly, the data generation module 502, when executing the step of storing the ER code configuration data based on the identification information, is specifically used to:
[0142] Store ER code configuration data based on identification information and code running environment information.
[0143] Optionally, in some of the embodiments, the data generation module 502, when performing the step of storing the ER code configuration data based on the identification information, is specifically configured to:
[0144] Based on the identification information, the ER code configuration data is stored in each edge node in the content distribution network.
[0145] Optionally, in some of the embodiments, the pre-developed edge program ER function code includes: a service function code and a service monitoring function code; the service monitoring function code is used to perform service anomaly monitoring during the process of running the service function code at the edge node in the content distribution network.
[0146] The data processing device of this embodiment is used to implement the corresponding data processing method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of this embodiment can refer to the description of the corresponding part in the above-mentioned method embodiment, which will not be described in detail here.
[0147] Figure 6 The data processing device provided by the embodiment of the present application is located at an edge node in a content distribution network, and an edge program and pre-developed edge program ER function code are deployed in the edge node. The data processing device may include:
[0148] A receiving module 602, configured to receive a user request through an edge program;
[0149] The parsing module 604 is used to parse the user request and obtain the identification information contained in the user request. The identification information is the identification information corresponding to the ER code configuration data. The ER code configuration data is obtained by Figure 1 The data processing method provided by the illustrated embodiment generates;
[0150] A determination module 606 is used to determine target ER code configuration data from a pre-built configuration database according to the identification information;
[0151] The response module 608 is used to run the ER function code based on the target ER code configuration data, obtain the request response result, and return the request response result.
[0152] Optionally, in some of the embodiments, the number of pre-developed ER function codes is multiple, the target ER code configuration data includes multiple code configuration data segments, and the multiple code configuration data segments have a preset sequence; one code configuration data segment corresponds to one ER function code;
[0153] Correspondingly, when executing the step of running the ER function code based on the target ER code configuration data to obtain the request response result, the response module 608 is specifically used to:
[0154] Based on multiple code configuration data fragments included in the target ER code configuration data and a preset sequence between the multiple code configuration data fragments, multiple pre-developed ER function codes are run in sequence to obtain a request response result.
[0155] Optionally, in some of the embodiments, the parsing module 604 is specifically used to: parse the user request to obtain the identification information and code running environment information contained in the user request;
[0156] Correspondingly, the determination module 606 is specifically configured to:
[0157] Determine multiple candidate ER code configuration data from a pre-built configuration database according to the identification information;
[0158] According to the code running environment information, target ER code configuration data is determined from a plurality of candidate ER code configuration data.
[0159] Optionally, in some of the embodiments, the parsing module 604 is specifically used to: parse and obtain identification information contained in the user request according to the path field in the user request; parse and obtain code running environment information contained in the user request according to the domain name field in the user request.
[0160] Optionally, in some of the embodiments, the pre-developed ER function code includes: a service function code and a service monitoring function code;
[0161] Correspondingly, the response module 608 is specifically used for:
[0162] Run the service function code based on the target ER code configuration data, obtain the request response result, and return the request response result;
[0163] During the operation of the service function code, the service monitoring function code is run in parallel based on the target ER code configuration data to monitor the abnormal operation of the service function code and output abnormal alarm information when abnormal operation of the service function code is detected.
[0164] Optionally, in some of the embodiments, the data processing device may further include:
[0165] A code replacement module is used to receive a modified ER function code sent by a client device before running the ER function code based on the target ER code configuration data, wherein the modified ER function code is a code obtained after modifying the deployed ER function code; and replace the ER function code with the modified ER function code;
[0166] Correspondingly, the response module 608, when executing the step of running the ER function code based on the target ER code configuration data, is specifically used to:
[0167] The modified ER function is parameterized according to the target ER code configuration data, and the parameterized modified ER function is run.
[0168] The data processing device of this embodiment is used to implement the corresponding data processing method in the above-mentioned embodiment, and has the beneficial effects of the corresponding method embodiment, which will not be described in detail here. In addition, the functional implementation of each module in the data processing device of this embodiment can refer to the description of the corresponding part in the above-mentioned method embodiment, which will not be described in detail here.
[0169] Reference Figure 7 , shows a schematic diagram of the structure of an electronic device according to an embodiment of the present application. The specific embodiment of the present application does not limit the specific implementation of the electronic device.
[0170] like Figure 7As shown, the electronic device may include: a processor (processor) 702 , a communication interface (Communications Interface) 704 , a memory (memory) 706 , and a communication bus 708 .
[0171] in:
[0172] The processor 702 , the communication interface 704 , and the memory 706 communicate with each other via a communication bus 708 .
[0173] The communication interface 704 is used to communicate with other electronic devices.
[0174] The processor 702 is used to execute the program 710, and specifically can execute the relevant steps in the above data processing method embodiment.
[0175] Specifically, the program 710 may include program codes, which include computer operation instructions.
[0176] The processor 702 may be a CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.
[0177] The memory 706 is used to store the program 710. The memory 706 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0178] The program 710 may include multiple computer instructions. Specifically, the program 710 may enable the processor 702 to execute operations corresponding to the method described in any of the aforementioned method embodiments through the multiple computer instructions.
[0179] The specific implementation of each step in program 710 can refer to the corresponding description of the corresponding steps and units in the above method embodiment, and has corresponding beneficial effects, which will not be repeated here. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described devices and modules can refer to the corresponding process description in the above method embodiment, which will not be repeated here.
[0180] The present application also provides a computer storage medium on which a computer program is stored, and when the program is executed by a processor, the method described in any of the above-mentioned method embodiments is implemented. The computer storage medium includes, but is not limited to: a compact disc read-only memory (CD-ROM), a random access memory (RAM), a floppy disk, a hard disk, or a magneto-optical disk.
[0181] An embodiment of the present application also provides a computer program product, including computer instructions, which instruct a computing device to execute operations corresponding to any one of the above-mentioned multiple method embodiments.
[0182] In addition, it should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used to train the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data need to comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0183] It should be pointed out that, according to the needs of implementation, the various components / steps described in the embodiments of the present application can be split into more components / steps, or two or more components / steps or partial operations of components / steps can be combined into new components / steps to achieve the purpose of the embodiments of the present application.
[0184] The above-mentioned method according to the embodiment of the present application can be implemented in hardware, firmware, or implemented as software or computer code that can be stored in a recording medium (such as a CD-ROM, RAM, floppy disk, hard disk or magneto-optical disk), or implemented as a computer code originally stored in a remote recording medium or a non-temporary machine-readable medium downloaded through a network and stored in a local recording medium, so that the method described herein can be stored in such software processing on a recording medium using a general-purpose computer, a dedicated processor or programmable or dedicated hardware (such as an application-specific integrated circuit (ASIC) or a field programmable gate array (FPGA)). It can be understood that a computer, a processor, a microprocessor controller or programmable hardware includes a storage component (e.g., a random access memory (RAM), a read-only memory (ROM), a flash memory, etc.) that can store or receive software or computer code, and when the software or computer code is accessed and executed by a computer, a processor or hardware, the method described herein is implemented. In addition, when a general-purpose computer accesses the code for implementing the method shown here, the execution of the code converts the general-purpose computer into a dedicated computer for executing the method shown here.
[0185] Those of ordinary skill in the art will appreciate that the units and method steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present application.
[0186] The above implementation methods are only used to illustrate the embodiments of the present application, and are not limitations on the embodiments of the present application. Ordinary technicians in the relevant technical field can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application. Therefore, all equivalent technical solutions also belong to the scope of the embodiments of the present application. The scope of patent protection of the embodiments of the present application should be limited by the claims.
Claims
1. A data processing method, applied to a client device, comprising: Displaying a code parameter configuration interface, wherein the code parameter configuration interface is used to configure code running parameters for the pre-developed edge program ER function code; In response to the parameter configuration operation in the code parameter configuration interface, ER code configuration data is generated to run the ER function code in an edge node in a content distribution network based on the ER code configuration data.
2. The method according to claim 1, wherein: There are multiple ER function codes that have been pre-developed, and multiple ER function code icons are displayed in the code parameter configuration interface; the ER function code icons correspond to the ER function codes one by one; The generating of the configuration data of the ER code in response to the parameter configuration operation in the code parameter configuration interface includes: In response to a selection operation of an ER function code icon in the code parameter configuration interface, a parameter configuration sub-interface corresponding to the selected ER function code icon is displayed; Generate configuration data for the selected ER function code according to the code parameter information set in the parameter configuration sub-interface; The configuration data of the selected ER function codes are combined to generate ER code configuration data.
3. The method according to claim 2, wherein: The combining the configuration data of the selected ER function code to generate ER code configuration data includes: The configuration data of each selected ER function code is combined in the order of selection of each selected ER function code icon, and the ER code configuration data is generated.
4. The method according to claim 2, wherein: The code parameter configuration interface also displays a combination relationship icon; the configuration data of the selected ER function code is combined to generate ER code configuration data, including: In response to a triggering operation on a combination relationship icon displayed in the code parameter configuration interface, determining a combination relationship between each selected ER function code icon; According to the combination relationship between the selected ER function code icons, the configuration data of the selected ER function codes are combined to generate the ER code configuration data.
5. The method according to any one of claims 1 to 4, wherein: The method further comprises: Displaying a code editing interface, wherein the code editing interface includes a plurality of code editing icons, wherein the code editing icons correspond one to one to the ER function codes; In response to a selection operation of a target code editing icon in the code editing interface, acquiring and displaying a target ER function code corresponding to the target code editing icon; According to the modification operation on the target ER function code, a modified ER function code is generated, so as to replace the target ER function code pre-deployed to the edge node in the content distribution network with the modified ER function code.
6. The method according to any one of claims 1 to 4, wherein: After generating the ER code configuration data, the method further includes: Identification information is generated for the ER code configuration data, and the ER code configuration data is stored based on the identification information.
7. The method according to claim 6, wherein: After generating identification information for the ER code configuration data, the method further includes: Receiving code running environment information set for the ER code configuration data input by a user; The storing the ER code configuration data based on the identification information includes: Based on the identification information and the code running environment information, the ER code configuration data is stored.
8. The method according to claim 6, wherein: The storing the ER code configuration data based on the identification information includes: Based on the identification information, the ER code configuration data is stored in each edge node in the content distribution network.
9. The method according to claims 1-4, wherein: The pre-developed edge program ER function code includes: a service function code and a service monitoring function code; the service monitoring function code is used to perform service anomaly monitoring during the process of running the service function code on the edge node in the content distribution network.
10. A data processing method, applied to an edge node in a content distribution network, wherein an edge program and pre-developed edge program ER function code are deployed in the edge node, the method comprising: receiving a user request through the edge program; Parsing the user request to obtain identification information contained in the user request, wherein the identification information is identification information corresponding to the ER code configuration data; the ER code configuration data is generated by the method according to any one of claims 1 to 9; Determine target ER code configuration data from a pre-built configuration database according to the identification information; The ER function code is run based on the target ER code configuration data, a request response result is obtained, and the request response result is returned.
11. The method according to claim 10, wherein: There are multiple pre-developed ER function codes, the target ER code configuration data includes multiple code configuration data segments, and the multiple code configuration data segments have a preset sequence; one code configuration data segment corresponds to one ER function code; The step of running the ER function code based on the target ER code configuration data to obtain a request response result includes: Based on the multiple code configuration data fragments included in the target ER code configuration data and the preset sequence between the multiple code configuration data fragments, the multiple ER function codes developed in advance are run in sequence to obtain a request response result.
12. The method according to claim 10 or 11, wherein: The parsing of the user request to obtain identification information contained in the user request includes: Parsing the user request to obtain identification information and code running environment information contained in the user request; Determining target ER code configuration data from a pre-built configuration database according to the identification information includes: Determine, based on the identification information, a plurality of candidate ER code configuration data from a pre-built configuration database; According to the code running environment information, target ER code configuration data is determined from the plurality of candidate ER code configuration data.
13. The method according to claim 12, wherein: The parsing of the user request to obtain identification information and code running environment information contained in the user request includes: According to the path field in the user request, the identification information contained in the user request is parsed; according to the domain name field in the user request, the code running environment information contained in the user request is parsed.
14. The method according to claim 10, wherein: The pre-developed ER function code includes: service function code and service monitoring function code; The step of running the ER function code based on the target ER code configuration data, obtaining a request response result, and returning the request response result includes: Running the service function code based on the target ER code configuration data, obtaining a request response result, and returning the request response result; During the operation of the service function code, the service monitoring function code is run in parallel based on the target ER code configuration data to monitor the operation of the service function code for abnormalities, and output abnormal alarm information when abnormal operation of the service function code is detected.
15. The method according to claim 10, wherein: Before running the ER function code based on the target ER code configuration data, the method further includes: Receiving a modified ER function code sent by a client device, wherein the modified ER function code is a code obtained after a modification operation is performed on the deployed ER function code; Replacing the ER function code with the modified ER function code; The running the ER function code based on the target ER code configuration data includes: The modified ER function is parameterized according to the target ER code configuration data, and the parameterized modified ER function is run.
16. An electronic device comprising: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform an operation corresponding to the method according to any one of claims 1-15.
17. A computer storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the method according to any one of claims 1 to 15 is implemented.
18. A computer program product, comprising computer instructions, wherein the computer instructions instruct a computing device to perform operations corresponding to the method according to any one of claims 1 to 15.