Data processing method, apparatus, computer program product, device, and storage medium
Patent Information
- Application Number
- CN202111531750.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-15
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2041-12-15
AI Technical Summary
[0029]本申请实施例可获取目标业务服务页面的目标源代码、目标源代码中的各个模型字段以及各个模型字段的属性信息,以便于后续基于获取到的内容创建各个模型字段对应的自定义字段,以及各个自定义字段的属性信息,即创建关于目标业务服务页面的一个或多个自定义字段以及各个自定义字段的属性信息;在创建各个自定义字段以及每个自定义字段的属性信息后,可根据目标业务服务页面的业务形态和各个自定义字段的属性信息,确定每个自定义字段的模拟数据,并采用各个自定义字段的模拟数据对相应的自定义字段的字段内容进行填充,从而自动拉取各个自定义字段的字段内容,可有效避免未对自定义字段的字段内容进行填充的情况。然后,可根据填充后的自定义字段生成目标业务服务页面的配置文件,从而便捷地获取到用于渲染目标业务服务页面的配置文件。可见,本申请实施例可快速地获取用于渲染目标业务服务页面的配置文件,解决了需要人工配制自定义字段和项目字段(即模型字段)人工核对的问题,以节约人工成本。另外,解决了人工创建自定义字段后未填充字段内容造成项目需求生成发布时的报错风险和业务风险;也就是说,通过本申请实施例获取到的配置文件中的各个自定义字段的字段内容均被填充,可在项目需求生成发布时,有效避免由于配置文件错误而导致的报错风险和业务风险。
Smart Images

Figure CN116263659B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer program product, device and storage medium. Background Technology
[0002] Currently, with the continuous development of internet technology, the construction of business service pages has been widely adopted. In the process of building these pages, front-end developers typically create the user interface, while back-end developers write the source code to enable interaction between the server and database. This leads to back-end developers usually having expertise in database and API design, while front-end developers often have weaker data-related knowledge, making it difficult for them to independently build business service pages—specifically, they struggle to generate configuration files for rendering these pages. Therefore, how to conveniently obtain these configuration files has become a research hotspot. Summary of the Invention
[0003] This invention provides a data processing method, apparatus, computer program product, device, and storage medium that can efficiently and conveniently obtain configuration files used to render target business service pages.
[0004] On one hand, embodiments of this application provide a data processing method, the method comprising:
[0005] Obtain the target source code of the target business service page, and the field analysis results of the target source code; the field analysis results include each model field extracted from the target source code and the attribute information of each model field, where model fields refer to code fields that support data modification;
[0006] Based on the target source code and the field analysis results, create one or more custom fields for the target business service page and attribute information for each custom field; wherein, one custom field corresponds to one model field, and a custom field is a field for which no field content is specified;
[0007] Based on the business type of the target business service page and the attribute information of each custom field, determine the simulated data for each custom field; and fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0008] After the target source code is released, the configuration file is used to render the target business service page.
[0009] On the other hand, embodiments of this application provide a data processing apparatus, the apparatus comprising:
[0010] The acquisition unit is used to acquire the target source code of the target business service page and the field analysis results of the target source code; the field analysis results include each model field extracted from the target source code and the attribute information of each model field, where the model field refers to the code field that supports data modification;
[0011] The processing unit is used to create one or more custom fields and attribute information of each custom field for the target business service page based on the target source code and the field analysis results; wherein, one custom field corresponds to one model field, and a custom field is a field whose content is not specified.
[0012] The processing unit is further configured to determine the simulated data of each custom field based on the business type of the target business service page and the attribute information of each custom field; and to fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0013] After the target source code is released, the configuration file is used to render the target business service page.
[0014] In another aspect, embodiments of this application provide a computer program product, which, when executed by a processor, performs the following steps:
[0015] Obtain the target source code of the target business service page, and the field analysis results of the target source code; the field analysis results include each model field extracted from the target source code and the attribute information of each model field, where model fields refer to code fields that support data modification;
[0016] Based on the target source code and the field analysis results, create one or more custom fields for the target business service page and attribute information for each custom field; wherein, one custom field corresponds to one model field, and a custom field is a field for which no field content is specified;
[0017] Based on the business type of the target business service page and the attribute information of each custom field, determine the simulated data for each custom field; and fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0018] After the target source code is released, the configuration file is used to render the target business service page.
[0019] In another aspect, embodiments of this application provide a computer device, the computer device including a processor and a memory, wherein the memory is used to store a computer program, and the computer program, when executed by the processor, performs the following steps:
[0020] Obtain the target source code of the target business service page, and the field analysis results of the target source code; the field analysis results include each model field extracted from the target source code and the attribute information of each model field, where model fields refer to code fields that support data modification;
[0021] Based on the target source code and the field analysis results, create one or more custom fields for the target business service page and attribute information for each custom field; wherein, one custom field corresponds to one model field, and a custom field is a field for which no field content is specified;
[0022] Based on the business type of the target business service page and the attribute information of each custom field, determine the simulated data for each custom field; and fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0023] After the target source code is released, the configuration file is used to render the target business service page.
[0024] In another aspect, embodiments of this application provide a computer storage medium storing a computer program adapted for loading by a processor and executing the following steps:
[0025] Obtain the target source code of the target business service page, and the field analysis results of the target source code; the field analysis results include each model field extracted from the target source code and the attribute information of each model field, where model fields refer to code fields that support data modification;
[0026] Based on the target source code and the field analysis results, create one or more custom fields for the target business service page and attribute information for each custom field; wherein, one custom field corresponds to one model field, and a custom field is a field for which no field content is specified;
[0027] Based on the business type of the target business service page and the attribute information of each custom field, determine the simulated data for each custom field; and fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0028] After the target source code is released, the configuration file is used to render the target business service page.
[0029] This application embodiment can obtain the target source code of the target business service page, each model field in the target source code, and the attribute information of each model field. This facilitates the subsequent creation of custom fields corresponding to each model field and the attribute information of each custom field based on the obtained content. Specifically, it creates one or more custom fields for the target business service page and their attribute information. After creating each custom field and its attribute information, simulated data for each custom field can be determined based on the business form of the target business service page and the attribute information of each custom field. The simulated data is then used to populate the content of the corresponding custom fields, automatically retrieving the content of each custom field and effectively avoiding situations where the content of custom fields is not populated. Then, a configuration file for the target business service page can be generated based on the populated custom fields, thus conveniently obtaining the configuration file used to render the target business service page. Therefore, this application embodiment can quickly obtain the configuration file used to render the target business service page, solving the problem of manually configuring and verifying custom fields and project fields (i.e., model fields), thereby saving labor costs. In addition, this invention resolves the risk of errors and business risks during project requirement generation and release caused by manually created custom fields not being filled in. In other words, the content of each custom field in the configuration file obtained through this application embodiment is filled in, which can effectively avoid the risk of errors and business risks caused by configuration file errors during project requirement generation and release. Attached Figure Description
[0030] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0031] Figure 1 This is a flowchart illustrating a data processing scheme provided in an embodiment of this application;
[0032] Figure 2This is a flowchart illustrating a data processing method provided in an embodiment of this application;
[0033] Figure 3a This is a schematic diagram of a display interface provided in an embodiment of this application;
[0034] Figure 3b This is a schematic diagram of another display interface provided in an embodiment of this application;
[0035] Figure 4 This is a flowchart illustrating another data processing method provided in an embodiment of this application;
[0036] Figure 5 This is a schematic diagram of a communication process provided in an embodiment of this application;
[0037] Figure 6 This is a schematic diagram illustrating the code information submission progress provided in an embodiment of this application;
[0038] Figure 7 This is a schematic diagram of a binary tree structure provided in an embodiment of this application;
[0039] Figure 8 This is a schematic diagram of another communication process provided in an embodiment of this application;
[0040] Figure 9 This is a schematic diagram of a process for determining simulation data provided in an embodiment of this application;
[0041] Figure 10 This is a schematic diagram of another display interface provided in an embodiment of this application;
[0042] Figure 11 This is a schematic diagram of the structure of a data processing device provided in an embodiment of this application;
[0043] Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0044] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.
[0045] To facilitate the acquisition of highly reliable configuration files, this application proposes a data processing scheme. In its implementation, this data processing scheme can be executed by a computer device, which can be a terminal or a server. The terminal mentioned herein can include, but is not limited to, smartphones, tablets, laptops, desktop computers, smartwatches, smart TVs, and smart vehicle terminals. Various clients (apps) can run within the terminal, such as video playback clients, social media clients, browser clients, news feed clients, educational clients, and so on. The server mentioned herein can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms, etc.
[0046] It should be noted that in other embodiments, the data processing scheme can also be executed jointly by a server and a terminal; the server and terminal are connected via a network (such as a wired network, wireless network, etc.), and this is not limited. Furthermore, the computer device mentioned in the embodiments of this application can be located outside or inside the blockchain network, and this is not limited; the so-called blockchain network is a network composed of a peer-to-peer network (P2P network) and a blockchain, while blockchain refers to a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, it is a decentralized database, a chain of data blocks (or blocks) linked together using cryptographic methods.
[0047] Furthermore, the above data processing scheme can be executed jointly by two computer devices, which can be a target code device and a data configuration device, respectively; or it can be executed jointly by two clients running within a single computer device, and this application does not limit this. For ease of explanation, this application's embodiments use two computer devices (i.e., a target code device and a data configuration device) as the execution entities of the data processing scheme as an example for illustration; see [link to documentation]. Figure 1 As shown, the general principle of the data processing scheme proposed in this application embodiment is as follows:
[0048] ① The target code device can generate source code files containing the source code of one or more business service pages. Each business service page's source code includes one or more model fields. ② When the target code device detects a commit trigger event for the source code file, it can use a code analysis script file within a code inspection hook function (such as pre-commit, a code inspection tool before code submission) to analyze the changed file and extract the model fields. This changed file can refer to a file that has not been committed within the time frame of its creation or modification time and the current system time. It can be understood that when the target code device first detects a commit trigger event, the source code of one or more business service pages contained in the source code file has not been committed. In other words, the changed file at this time is a source code file, meaning it includes all the source code within the source code file. For ease of explanation, the following description will use the changed file as a source code file as an example, whereby the target code device can perform code analysis on the source code file and extract the model fields. ③ The target code device can submit the source code file, the model fields within the source code file, and the attribute information of each model field to the data configuration device.
[0049] ④ After receiving the source code file, model fields, and attribute information of each model field from the target code device, the data configuration device can create one or more requirement data categories; one requirement data category corresponds to one business service page. ⑤ Based on the model fields and attribute information of each model field in the source code file, the data configuration device can create sub-custom fields in each requirement data category. Sub-custom fields refer to custom fields under each attribute information; a custom field in one requirement data category corresponds to a model field in the source code of a business service page. ⑥ The data configuration device can request the business system database to populate simulated data into each custom field in each requirement data category, thereby generating a configuration file based on the simulated data of each custom field. This configuration file can be used to render each business service page in the aforementioned one or more business service pages.
[0050] It is understood that the data processing scheme proposed in this application can extract data model items (i.e. model fields and attribute information of model fields) by scanning the system source code (i.e. source code) in the project development through pre-commit and data configuration device. Based on the data model items, it can automatically communicate with the data configuration device. While submitting the development source code, it can automatically generate custom field model data items (i.e. custom fields and attribute information of custom fields) in the data configuration device and generate simulation data, thereby obtaining the corresponding configuration file based on the simulation data of each custom field.
[0051] Practice has shown that the data processing scheme proposed in this application has at least the following beneficial effects:
[0052] First, the target code device can automatically analyze the source code of one or more business service pages contained in the source code file through code inspection hook functions, efficiently extracting various model fields from the source code file. Second, the data configuration device can automatically create custom fields corresponding to each model field based on the received model fields, and populate each custom field with simulated data to conveniently obtain the configuration file used to render each business service page, effectively saving manpower costs and avoiding the situation where custom fields in the configuration file have missing content. Third, custom fields can be created according to the required data classification set, facilitating subsequent management of each custom field. Fourth, when the target code device detects a submission trigger event for the source code file, it can obtain the changed file and perform code analysis on the changed file to extract the model fields from the changed file. In other words, when the target code device first detects a submission trigger event for the source code file, it can perform code analysis on all the source code in the source code file; and when it subsequently detects a submission trigger event for the source code file, it can perform code analysis on a portion of the source code in the source code file, effectively avoiding a large number of repetitive operations and reducing resource waste.
[0053] Based on the above description of the data processing scheme, this application proposes a data processing method. This data processing method can be executed by the aforementioned data configuration device (i.e., a computer device) or by the aforementioned object code device (i.e., another computer device). The computer device can be a terminal or a server; alternatively, the data processing method can be executed jointly by a terminal and a server. For ease of explanation, the following description will use the execution of this data processing method by a data configuration device as an example. It should be noted that the data configuration device in this application embodiment can also be called a data configuration platform. Please refer to... Figure 2 The data processing method may include the following steps S201-S203:
[0054] S201, Obtain the target source code of the target business service page, and the field analysis results of the target source code.
[0055] The field analysis results include various model fields extracted from the target source code and attribute information for each model field. Model fields refer to code fields that support data modification. It is understood that the aforementioned attribute information can refer to the field type of the model field, which may include, but is not limited to: single-line input boxes, multi-line input boxes, dates, radio buttons, drop-down lists, images, links, text, etc. Optionally, the model fields in this embodiment may also be referred to as data model fields.
[0056] It should be noted that the data configuration device can obtain source code files, which include the source code of one or more business service pages. Therefore, the target business service page mentioned above can be one of the one or more business service pages contained in the source code file, and the target source code can be the source code of one of the business service pages in the source code file.
[0057] Optionally, the data configuration device can download the target source code and field analysis results of the target business service page from the cloud according to user instructions, or it can obtain the target source code and field analysis results of the target business service page from a user-provided mobile storage device, such as a portable hard drive or USB flash disk. The data configuration device can also obtain the target source code and field analysis results of the target business service page from its own storage space. For example, if the target source code and corresponding field analysis results exist in the read-only memory (ROM) of the data configuration device, the data configuration device can obtain the target source code and field analysis results from that ROM. The data configuration device can also obtain the target source code and corresponding field analysis results from any computer device other than the data configuration device itself. That is, the data configuration device can obtain the target source code and corresponding field analysis results by receiving them from any computer device other than the data configuration device. This application does not limit the specific implementation method of the data configuration device obtaining the target source code and the target source code's field analysis results.
[0058] S202, Based on the target source code and field analysis results, create one or more custom fields for the target business service page, as well as attribute information for each custom field.
[0059] In this model, one custom field corresponds to one model field. A custom field is a field whose content is not specified. Essentially, a custom field refers to a field in the database that does not have a specified name or content. Custom fields are also called "open models," allowing users to add fields according to their needs and achieve personalized customization.
[0060] It should be noted that the attribute information of each of the above custom fields is the same as the attribute information of the corresponding model field; that is, the attribute information of any custom field is equal to the attribute information of the model field corresponding to that custom field. It can be understood that the data configuration device can use the attribute information of any model field as the attribute information of the custom field corresponding to that model field.
[0061] For example, suppose the field analysis results of the target source code include model field A and model field B, and the attribute information of model field A is a single-line input box, while the attribute information of model field B is a multi-line input box. Then, the data configuration device can create two custom fields and the attribute information of each of these custom fields. In this case, assuming the two custom fields created by the data configuration device are custom field A and custom field B, and custom field A corresponds to model field A, and custom field B corresponds to model field B, then the data configuration device can determine that the attribute information of custom field A is a single-line input box, and the attribute information of custom field B is a multi-line input box.
[0062] Understandably, once the data configuration device obtains the source code of multiple business service pages and the field analysis results of each source code, the data configuration device can create one or more custom fields for each business service page, as well as attribute information for each custom field in each business service page.
[0063] S203, based on the business type of the target business service page and the attribute information of each custom field, determine the simulated data for each custom field; and, use the simulated data of each custom field to fill in the field content of the corresponding custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0064] After the target source code is released, the aforementioned configuration file is used to render the target business service page. It should be noted that the aforementioned business model can be used to describe the overall layout and presentation of the target business service page. Correspondingly, a business model corresponds to a dataset. Therefore, the data configuration device can determine the dataset corresponding to the business model of the target business service page, and within the determined dataset, use the data matching the attribute information of each custom field as the corresponding simulated data. Here, the data matching the attribute information of any custom field refers to data whose data type is the data type corresponding to the attribute information of that custom field. Specifically, a business model can indicate one or more data types, and the target business service page can display data of each of these data types; therefore, the dataset corresponding to this business model includes data of each of the aforementioned data types.
[0065] For example, suppose a data configuration device creates a custom field A with the attribute information of "image," and the data configuration device includes dataset A and dataset B. The business format of the target business service page corresponds to dataset A. Then, the data configuration device can use data in dataset A that matches the attribute information of custom field A as the simulated data for custom field A. In other words, the data configuration device can determine the data type as "image" in dataset A and use this determined data as the simulated data for custom field A. Furthermore, assuming the simulated data for custom field A is simulated data A, the data configuration device can use simulated data A to populate the field content of custom field A, thereby obtaining the configuration file for the target business service page. In this case, when using this configuration file to render the target business service page, the target business service page can include the field content of custom field A; that is, the target business service page can include simulated data A.
[0066] Optionally, the simulated data mentioned above may refer to data on financial business, data on sales business, or data on advertising business; this application does not limit this.
[0067] It should be noted that the data configuration device can also create custom fields and their attribute information when it detects a user's visual operation. Optionally, if the target source code of the target business service page is updated, the user can create custom fields and their corresponding attribute information corresponding to the added model fields through visual operations in the data configuration device, or edit the custom fields created in the data configuration device according to the updated target source code, etc.; the user can also have the data configuration device re-obtain the target source code of the target business service page (i.e., the updated target source code) and the field analysis results of the updated target source code, thereby creating custom fields and their corresponding attribute information corresponding to the model fields in the updated target source code, that is, updating the custom fields and their corresponding attribute information. This application does not limit this.
[0068] For example, such as Figure 3a As shown, assuming the target source code of the target business service page corresponds to the data source in display interface 301, for example, the name of the target source code can be the corresponding data source name. Display interface 301 includes field management options. If the user clicks on the field management option, the data configuration device can respond to the user's click and display one or more custom fields created for the target business service page, along with the attribute information of each custom field, in display interface 302. Display interface 302 includes an option to add a field. When the target source code is updated, and the updated target source code adds at least one model field, assuming the user wants to create the custom field corresponding to the added model field and its attribute information through visual operations on the data configuration device, the user can click on the "Add Field" option in display interface 302. The data configuration device can respond to the user's click on the "Add Field" option and display the custom field creation interface in display interface 303. Display interface 303 includes input boxes for field keywords, input boxes for field types, a save option, etc. After entering the relevant content of a custom field, the user can click the save option in display interface 303. The data configuration device can then respond to the user's click and save the custom field created by the user through visual operation. It should be noted that... Figure 3a The display interface of the data configuration device is only illustrated by example. This application does not limit the specific display content of each display interface; for example, the save option in display interface 303 may also be a complete option, or display interface 303 may not include a return option, etc.
[0069] Furthermore, the data configuration device can publish the target source code and display its presentation information. For example, such as Figure 3bAs shown, assuming the data configuration device has already published the target source code, the data configuration device can display the presentation information of the published source code (i.e., the presentation information of the target source code) in the display interface 304. The display interface 304 may include editing options, deletion options, etc. of the target source code. Then, the user can perform corresponding operations on the target source code through the editing options or deletion options in the display interface 304. Furthermore, if the user clicks the new publication option in the display interface 304, the data configuration device can respond to the user's click on the new publication option and display the source code that is allowed to be published.
[0070] Understandably, when distributing the target source code, the data configuration device can also distribute the configuration file used to render the target business service page. Furthermore, users can download the target source code and the configuration file used to render the target business service page from the data configuration device, enabling any computer device to use the target source code and the configuration file to construct the target business service page.
[0071] This application embodiment can obtain the target source code of the target business service page, each model field in the target source code, and the attribute information of each model field. This facilitates the subsequent creation of custom fields corresponding to each model field and the attribute information of each custom field based on the obtained content. Specifically, it creates one or more custom fields for the target business service page and their attribute information. After creating each custom field and its attribute information, simulated data for each custom field can be determined based on the business form of the target business service page and the attribute information of each custom field. The simulated data is then used to populate the content of the corresponding custom fields, automatically retrieving the content of each custom field and effectively avoiding situations where the content of custom fields is not populated. Then, a configuration file for the target business service page can be generated based on the populated custom fields, thus conveniently obtaining the configuration file used to render the target business service page. Therefore, this application embodiment can quickly obtain the configuration file used to render the target business service page, solving the problem of manually configuring and verifying custom fields and project fields (i.e., model fields), thereby saving labor costs. In addition, this invention resolves the risk of errors and business risks during project requirement generation and release caused by manually created custom fields not being filled in. In other words, the content of each custom field in the configuration file obtained through this application embodiment is filled in, which can effectively avoid the risk of errors and business risks caused by configuration file errors during project requirement generation and release.
[0072] Please see Figure 4This is a flowchart illustrating another data processing method provided in an embodiment of this application. This data processing method can be executed by the aforementioned data configuration device (i.e., computer device), which can be a terminal or a server; alternatively, the data processing method can be executed jointly by a terminal and a server. For ease of explanation, the following description will use the execution of this data processing method by a data configuration device as an example. Please refer to... Figure 4 The data processing method may include the following steps S401-S403:
[0073] S401 receives code information submitted by the target code device.
[0074] The target code device refers to the device that generates the target source code for the target business service page. The code information includes the target source code and its field analysis results. These field analysis results are obtained by the target code device calling the code analysis script file in the code inspection hook function when it detects a commit trigger event for the target source code, and performing model field analysis on the target source code. It should be noted that the commit trigger event can refer to the execution event of the commit command, and the aforementioned code analysis script file can also be simply called a script file.
[0075] In this scenario, the user can commit code on the target code device, i.e., execute the `commit` command, triggering the pre-commit hook operation. That is, when the user executes the `commit` command on the target code device, the target code device can call the code analysis script file in the code inspection hook function (i.e., `pre-commit`) to analyze and process the model fields of the target source code, thereby obtaining the field analysis results of the target source code. Here, `pre-commit` is a hook built into Git (an open-source distributed version control system). It can traverse, inspect, or perform other operations on the commit content before we commit. Specifically, when the target code device detects a commit trigger event for the target source code, it can call the code analysis script file in the code inspection hook function to analyze and process the model fields of the target source code. It should be noted that `pre-commit` is executed after `git add` (a command to add files to the staging area) and then when `git commit` (a command to commit specified files from the staging area to the repository) is executed. If the script execution does not report any errors, the commit continues; otherwise, the commit operation is rejected.
[0076] For example, such as Figure 5As shown, the communication process between the target code device and the data configuration device can include three stages, where the target code device is the coordinator in each stage. If the current stage is the first stage (stage one), the participant can be the data configuration device; at this time, the coordinator can send a request to the participant to submit code information, and the participant can allow the code submission request sent by the coordinator. If the current stage is the second stage (stage two), the participant is the code analysis script file in the pre-commit; at this time, the coordinator can call the code analysis script file in the code inspection hook function to analyze and process the model fields of the target source code. If the current stage is the third stage (stage three), the participant can be the data configuration device; at this time, the device can submit code information to the participant, finally completing the submission operation. Furthermore, as... Figure 6 As shown, during the process of the target code device submitting code information, the target code device can display the submission progress of the code information sequentially.
[0077] It is understandable that the target code device calling the above code analysis script file to analyze and process the model fields of the target source code can refer to: triggering the script file in the pre-commit, the script file analyzing and extracting the logic in the code (i.e. the target source code) to extract each model field and the attribute information of each model field from the target source code.
[0078] In a specific implementation, the target source code includes multiple parameter acquisition requests, each corresponding to an object structure, and each parameter acquisition request includes a request address. The specific process of calling a code analysis script file to analyze the model fields of the target source code and obtain the field analysis results may include: traversing each parameter acquisition request in the target source code and determining the current parameter acquisition request being traversed; querying the request address included in the current parameter acquisition request for target keywords, where target keywords refer to code identifiers used to indicate whether field modification is permitted; if a target keyword is found, the object structure corresponding to the current parameter acquisition request is taken as a model field. Here, an object structure can refer to a field; "each parameter acquisition request corresponds to one object structure" can mean that each parameter acquisition request includes an object structure, or it can mean that each parameter acquisition request is followed by an object structure; this application does not limit this.
[0079] It should be noted that the aforementioned target keyword can refer to the keyword " / vtools" (a preset keyword), the parameter retrieval request can refer to the request itself, and the aforementioned object structure can refer to a field within the parameter retrieval request. In essence, the target code device can query and traverse the source code for the keyword " / vtools," find addresses containing "vtools" in the request, analyze the object structure used after the request, and this object structure becomes the custom field key value in the subsequent data configuration device—that is, the object structure is used as the extracted model field.
[0080] Furthermore, if the target keyword is found, the address suffix identifier of the request address in the current parameter retrieval request is determined; and the determined address suffix identifier is used as the attribute information of the model field corresponding to the current parameter retrieval request.
[0081] In this case, the target code device can determine the vtools address suffix identifier (i.e., the address suffix identifier of the request address containing the keyword / vtools), which will be the category key value (i.e. the attribute information of the custom field) to be created later in the data configuration device; and use the determined address suffix identifier as the attribute information of the corresponding model field.
[0082] It should be noted that the target source code may include multiple code segments, a parameter retrieval request may refer to one or more lines of code statements, and any of the multiple parameter retrieval requests can be located in any code segment. Optionally, the target code device may construct a binary tree according to the hierarchical structure between the multiple code segments, and use the resulting binary tree to traverse the parameter retrieval requests in the target source code. For example, as... Figure 7 As shown, any node in the binary tree can contain a code segment. The target code device can use the binary tree corresponding to the target source code to traverse the code segments in each node in turn to search for the parameter acquisition request in each code segment.
[0083] Furthermore, the code information may include the source code of one or more business service pages and the field analysis results of each source code. The target business service page is one of the aforementioned business service pages. The field analysis results of each source code are obtained by the target code device calling the code analysis script file in the code inspection hook function to perform model field analysis processing on each source code when it detects a submission trigger event for each source code. In this case, the specific method of calling the aforementioned code analysis script file to perform model field analysis processing on each source code to obtain the field analysis results may include: traversing each source code and using the currently traversed source code as the current target source code; calling the aforementioned code analysis script file to perform model field analysis processing on the current target source code to obtain the field analysis results of the current target source code; and obtaining the field analysis results of each source code after traversing all source codes.
[0084] S402, based on the target source code and field analysis results, create one or more custom fields for the target business service page, as well as attribute information for each custom field.
[0085] It should be noted that when the code information includes the source code of one or more business service pages and the field analysis results of each source code, the data configuration device can create one or more requirement data categories, with each requirement data category corresponding to one business service page. Based on the correspondence between requirement data categories and business service pages, the source code, and the field analysis results of each source code, the device creates one or more custom fields for each business service page corresponding to each requirement data category, along with attribute information for each custom field. Here, the custom fields included in any requirement data category can refer to one or more custom fields of the business service page corresponding to that requirement data category. In other words, the data configuration device can create all custom fields of a business service page within the same requirement data category.
[0086] For example, suppose the code information includes the source code A of business service page A, the field analysis results of source code A, the source code B of business service page B, and the field analysis results of source code B. The field analysis results of source code A include model field A, model field B, and model field C, and the field analysis results of source code B include model field D and model field E. Then, according to the principle that one set of requirement data corresponds to one business service page, the data configuration device can create requirement data set A and requirement data set B, where requirement data set A corresponds to business service page A, and requirement data set B corresponds to business service page B. Furthermore, the data configuration device can create custom field A, custom field B, and custom field C in the requirement data classification set A based on source code A and the field analysis results of source code A. Custom field A corresponds to model field A, custom field B corresponds to model field B, and custom field C corresponds to model field C. The data configuration device can also create custom field D and custom field E in the requirement data classification set B based on source code B and the field analysis results of source code B. Custom field D corresponds to model field D, and custom field E corresponds to model field E.
[0087] Furthermore, each model field in the field analysis result of any source code can carry a category identifier. This category identifier can refer to the name or keyword of the business service page indicated by any source code, or it can refer to the name or keyword of any source code itself; this application does not limit this. In this case, the data configuration device can create one or more requirement data categories based on the category identifiers carried by each model field in the field analysis result of each source code, with one requirement data category corresponding to one business service page; and create custom fields corresponding to model fields with the same category identifier in the same requirement data category. It is understood that all model fields in the field analysis result of the source code of the same business service page have the same category identifier.
[0088] In one implementation, the data configuration device can respond to a login request sent by the target code device, authenticate the target code device based on the access credential information carried in the login request, and after the target code device is successfully authenticated, return a successful login notification to the target code device to notify the target code device to submit code information; wherein, the code information also includes access credential information. Then, after receiving the code information, the data configuration device can perform a reliability verification on the code information based on the access credential information in the code information, and after the code information passes the reliability verification, trigger the execution of the above-mentioned steps of creating one or more custom fields and attribute information of each custom field for the target business service page based on the target source code and field analysis results. The successful login notification may refer to status code 200, or a successful login identifier, etc.
[0089] Understandably, after receiving the code information and performing verification (i.e., reliability check), the data configuration device can automatically create category key values (i.e., attribute information of custom fields) and custom fields via API (Application Programming Interface). In this case, the category key values and custom fields are created implicitly through the API interface, and the resulting display is consistent with manually configured fields. In other words, after receiving the code information, the data configuration device can automatically create the corresponding custom fields and their attribute information, and the automatically created custom fields are identical to those created by the user through visual operations on the data configuration device.
[0090] It should be noted that the credential information carried in the login request can be the same as or different from the credential information included in the code information; this application does not impose any restrictions on this. Optionally, the credential information carried in the login request can be the login name and password, or the developer's identity information, etc.; while the credential information in the code information can be the developer's identity information, or the authentication information sent to the target code device when the data configuration device returns a successful login notification to the target code device, such as JWT (JSON Web Token, an open standard based on JSON), etc. A JWT can refer to a string, consisting of a header, payload, and signature. The JWT header describes the most basic information of the JWT, such as the type of the JWT and the algorithm used for signing. The JWT payload refers to the location where valid information is stored, which can include claims registered in the standard (such as the JWT issuer, the unique identifier of the JWT, etc.), public claims, and private claims.
[0091] In this scenario, when the data configuration device authenticates the target code device based on the access credential information carried in the login request, it can compare and analyze the access credential information carried in the login request with the preset access credential information stored in the data configuration device. If the access credential information carried in the login request is the same as the preset verification information, then the target code device can be determined to have passed authentication. Optionally, the preset verification information can be pre-set by the data configuration device or set by the user according to their wishes; this application does not limit this. For example, assuming that the access credential information carried in the login request refers to a login name and a login password, and that the access credential information carried in the login request includes login name A and login password A, and assuming that the preset verification information in the data configuration device includes login name A and login password A, then the data configuration device can determine that the target code device has passed authentication.
[0092] For example, such as Figure 8 As shown, if the target code device sends a login request to the data configuration device, the data configuration device can respond to the login request and authenticate the target code device based on the access credential information carried in the login request. After the target code device is successfully authenticated, the data configuration device can return a status code 200 to the target code device to notify the target code device to submit code information. It is understandable that... Figure 8 This application merely illustrates the interaction process between the target code device and the data configuration device, and does not limit its scope; for example, Figure 8 The data configuration device can also send a code information transmission request to the target code device to obtain the code information in the target code device. Optionally, such as... Figure 8 As shown, after submission, the data configuration device can also send a submission completion message to the target code device to notify the target code device that the submission has been completed.
[0093] Furthermore, when performing reliability verification on code information based on the access credential information in the code information, the data configuration device can compare and analyze the access credential information in the code information with the preset verification information in the data configuration device. If the access credential information in the code information is the same as the preset verification information, then the code information can be determined to have passed the reliability verification. Optionally, the preset verification information can be set by the data configuration device, set by the user according to their wishes, or it can be verification information carried in the login request. That is, after the target code device is authenticated, the data configuration device can use the verification information carried in the login request as the preset verification information, and so on.
[0094] For example, assuming the credentials in the code information refer to developer identity information, the target code device can send the code information to the data configuration device using a Node.js (Node.js, a server-side web programming language) request, carrying the developer identity information, category key values (i.e., attribute information of model fields), and a set of model field keys (i.e., all model fields extracted from the target source code). In this case, the preset verification information in the data configuration device can refer to the developer identity information; assuming the developer identity information carried by the code information is developer identity information A, and the preset verification information in the data configuration device is also developer identity information A, then the developer identity information iterates through the code information is the same as the preset verification information, and the data configuration device can determine that the code information has passed the reliability verification.
[0095] S403, based on the business type of the target business service page and the attribute information of each custom field, determine the simulated data for each custom field; and, use the simulated data of each custom field to fill in the field content of the corresponding custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0096] It's important to note that after creating the category key and custom field set in the previous step, the target code device can combine a single field from the custom field set to request the business system and return daily simulation data. Here, the business system can also refer to the business system database, and a single field from the custom field set can refer to one of all the custom fields created by the data configuration device. In other words, the data configuration device can request the business system database to determine the simulation data for each custom field.
[0097] In one implementation, the specific process by which the data configuration device determines the simulated data for each custom field based on the business format of the target business service page and the attribute information of each custom field may include: performing pattern processing based on each custom field and its corresponding attribute information to obtain one or more patterns, where each pattern includes at least one custom field and its corresponding attribute information; generating a data acquisition request using each pattern and the business format of the target business service page, and sending the data acquisition request to the business system database, so that the business system database returns simulated data for each custom field according to the business format and each pattern; and receiving the simulated data for each custom field returned by the business system database. It is understood that the aforementioned data acquisition request includes each pattern and the business format of the target business service page.
[0098] For example, such as Figure 9As shown, the data configuration device can use a pattern generator to process each custom field and its attribute information to obtain one or more patterns. The obtained patterns, along with the business format of the target business service page, are then sent to the business generator (i.e., the business system database). This allows the business generator to determine the corresponding simulated data for each custom field based on the business format of the target business service page and the attribute information of each custom field. It is understandable that... Figure 9 This application merely illustrates the process of requesting a business generator to obtain simulated data for each custom field, and does not limit the scope of the application. For example, the data configuration device may send the simulated data for each custom field determined in the business generator to a relational database generator (such as an Oracle generator), thereby enabling the Oracle generator to save the simulated data for each custom field. Alternatively, it may choose not to save the simulated data for each custom field to the database system, and so on.
[0099] For example, suppose the data configuration device creates custom field A and custom field B, where the attribute information for custom field A is "image" and the attribute information for custom field B is "link." The data configuration device can then perform schema processing on custom fields A and B to obtain one or more schemas. If, after schema processing, the data configuration device obtains a schema that includes custom field A, custom field B, the attribute information for custom field A, and the attribute information for custom field B, then the data configuration device can send this schema and the business format of the target business service page to the business system database. This allows the business system database to determine the simulated data for custom fields A and B. Furthermore, after the business system database determines the simulated data for custom fields A and B, the data configuration device can receive the simulated data for each custom field returned by the business system database.
[0100] In another implementation, the specific process of the data configuration device generating the configuration file for the target business service page based on the populated custom fields may include: using the template engine syntax of a hypertext preprocessor to convert the configuration data corresponding to each populated custom field to obtain the configuration file. It should be noted that a hypertext preprocessor (PHP) can refer to a general-purpose open-source scripting language, and the aforementioned template engine can refer to Smarty, a PHP-based template engine that is one of the most well-known PHP template engines in the industry.
[0101] It should be noted that the data configuration device can obtain configuration data by batch importing the populated custom fields into the established data table; and uses template engine syntax to convert the configuration data into configuration files.
[0102] For example, such as Figure 10 As shown, assuming the content of the template engine syntax is the template content displayed in the display interface 1001, the template engine syntax can be as follows:
[0103]
[0104] Correspondingly, the configuration file obtained by the data configuration device through the aforementioned template engine syntax can include the field content of the custom field "rule". Further, assuming the populated custom field "rule" includes field content A and field content B, then through... Figure 10 The template content shown can be used to obtain the following configuration file content: {"redenveloptwo":[{"rule":"field content A"},{"rule":"field content B"}]}; that is, the custom field corresponding to the source code named redenveloptwo includes the custom field rule, and the field content of the custom field rule can be field content A and field content B.
[0105] This application embodiment can receive code information submitted by a target code device. The code information includes the target source code and the field analysis results of the target source code. The field analysis results are obtained by the target code device calling the code analysis script file in the code inspection hook function to analyze the model fields of the target source code when it detects a submission trigger event for the target source code. In other words, the target code device can extract the business requirement data model fields through automatic source code analysis, that is, it can automatically extract the model fields and the attribute information of each model field from the target source code using the code analysis script file in the code inspection hook function. Then, while communicating with the target code device, custom fields can be created in the data configuration device based on the analyzed data model fields (i.e., model fields). Simulated initialization data is then populated into these custom fields according to the business context, reducing systemic risks. In other words, the data configuration device can create one or more custom fields for the target business service page, along with attribute information for each custom field. Based on the business context of the target business service page and the attribute information of each custom field, it determines the simulated data for each custom field and uses this simulated data to populate the content of the corresponding custom fields. This automatically determines the content of each custom field, effectively avoiding omissions and facilitating the acquisition of the corresponding configuration file. Therefore, the target code device can communicate with the data configuration device before project requirements are submitted via pre-commit (i.e., code inspection hook functions) to enable the automatic creation and population of custom fields, efficiently obtaining the configuration file used to render the target business service page.
[0106] Based on the description of the relevant embodiments of the above data processing method, this application also proposes a data processing apparatus, which can be a computer program (including program code) running on a computer device. This data processing apparatus can execute... Figure 2 or Figure 4 The data processing method shown; please refer to [link / reference]. Figure 11 The data processing device can operate the following units:
[0107] The acquisition unit 1101 is used to acquire the target source code of the target business service page and the field analysis results of the target source code; the field analysis results include each model field extracted from the target source code and the attribute information of each model field, where the model field refers to the code field that supports data modification;
[0108] Processing unit 1102 is used to create one or more custom fields and attribute information of each custom field for the target business service page based on the target source code and the field analysis results; wherein, one custom field corresponds to one model field, and a custom field refers to a field whose content is not specified.
[0109] The processing unit 1102 is further configured to determine the simulated data of each custom field based on the business form of the target business service page and the attribute information of each custom field; and to fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields.
[0110] After the target source code is released, the configuration file is used to render the target business service page.
[0111] In one embodiment, when acquiring the target source code of the target business service page and the field analysis results of the target source code, the acquisition unit 1101 may specifically be used for:
[0112] Receive code information submitted by the target code device, wherein the target code device refers to the device that generates the target source code of the target business service page;
[0113] The code information includes: the target source code and the field analysis results of the target source code; the field analysis results are obtained by the target code device calling the code analysis script file in the code inspection hook function to analyze and process the model fields of the target source code when it detects a submission trigger event for the target source code.
[0114] In another embodiment, the above-mentioned device further includes an output unit 1103; the processing unit 1102 can also be used to: in response to a login request sent by the target code device, authenticate the target code device according to the access credential information carried in the login request;
[0115] After the target code device passes the authentication, the output unit 1103 can be used to: return a successful login notification to the target code device to notify the target code device to submit code information; wherein, the code information also includes access credential information;
[0116] After receiving the code information, the processing unit 1102 can also be used to: perform a reliability check on the code information based on the access credential information in the code information, and after the code information passes the reliability check, trigger the execution of the step of creating one or more custom fields and attribute information of each custom field for the target business service page based on the target source code and the field analysis results.
[0117] In another embodiment, when the processing unit 1102 determines the simulated data for each custom field based on the business type of the target business service page and the attribute information of each custom field, it may specifically be used to:
[0118] Based on the custom fields and corresponding attribute information, pattern processing is performed to obtain one or more patterns. A pattern includes at least one custom field and corresponding attribute information.
[0119] Using the various modes and the business form of the target business service page, a data acquisition request is generated and sent to the business system database, so that the business system database returns simulated data of each custom field according to the business form and the various modes;
[0120] Receive simulated data for each custom field returned by the database of the business system.
[0121] In another embodiment, when the processing unit 1102 generates the configuration file for the target business service page based on the filled custom fields, it may specifically be used to:
[0122] The configuration data corresponding to each of the populated custom fields is transformed using the template engine syntax of the hypertext preprocessor to obtain the configuration file.
[0123] According to one embodiment of this application, Figure 2 or Figure 4 Each step involved in the method shown can be derived from... Figure 11 This is performed by each unit in the data processing apparatus shown. For example, Figure 2 Step S201 shown can be performed by Figure 11 The acquisition unit 1101 shown is executed, and steps S202 and S203 can both be performed by... Figure 11 The processing unit 1102 shown executes this. For example, Figure 4 Step S401 shown can be performed by Figure 11 The acquisition unit 1101 shown is executed, and steps S402 and S403 can both be performed by... Figure 11 The processing unit 1102 shown executes, etc.
[0124] According to another embodiment of this application, Figure 11 The data processing apparatus shown can be composed of individual or combined units into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are based on logical function division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the data processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.
[0125] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 2 or Figure 4 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 11 The data processing apparatus shown herein, and the data processing method for implementing the embodiments of this application, are described. The computer program may be recorded on, for example, a computer-readable storage medium, loaded onto the aforementioned computing device via the computer-readable storage medium, and run therein.
[0126] This application embodiment can obtain the target source code of the target business service page, each model field in the target source code, and the attribute information of each model field. This facilitates the subsequent creation of custom fields corresponding to each model field and the attribute information of each custom field based on the obtained content. Specifically, it creates one or more custom fields for the target business service page and their attribute information. After creating each custom field and its attribute information, simulated data for each custom field can be determined based on the business form of the target business service page and the attribute information of each custom field. The simulated data is then used to populate the content of the corresponding custom fields, automatically retrieving the content of each custom field and effectively avoiding situations where the content of custom fields is not populated. Then, a configuration file for the target business service page can be generated based on the populated custom fields, thus conveniently obtaining the configuration file used to render the target business service page. Therefore, this application embodiment can quickly obtain the configuration file used to render the target business service page, solving the problem of manually configuring and verifying custom fields and project fields (i.e., model fields), thereby saving labor costs. In addition, this invention resolves the risk of errors and business risks during project requirement generation and release caused by manually created custom fields not being filled in. In other words, the content of each custom field in the configuration file obtained through this application embodiment is filled in, which can effectively avoid the risk of errors and business risks caused by configuration file errors during project requirement generation and release.
[0127] Based on the description of the above method and apparatus embodiments, this application also provides a computer device. Please refer to... Figure 12 The computer device includes at least a processor 1201, an input interface 1202, an output interface 1203, and a computer storage medium 1204. The processor 1201, input interface 1202, output interface 1203, and computer storage medium 1204 within the computer device can be connected via a bus or other means.
[0128] Computer storage medium 1204 can be stored in the memory of a computer device. The computer storage medium 1204 is used to store computer programs, which include program instructions. The processor 1201 is used to execute the program instructions stored in the computer storage medium 1204. The processor 1201 (or CPU) A central processing unit (CPU) is the computing and control core of a computer device, suitable for implementing one or more instructions, specifically for loading and executing one or more instructions to achieve a corresponding method flow or function. In one embodiment, the processor 1201 described in this application can be used to perform a series of data processing steps, specifically including: obtaining the target source code of a target business service page and the field analysis results of the target source code; the field analysis results include various model fields extracted from the target source code and attribute information of each model field, where a model field refers to a code field that supports data modification; based on the target source code and the field analysis results, creating one or more custom fields for the target business service page and attribute information of each custom field, wherein one custom field corresponds to one model field, and a custom field refers to a field without specified field content; determining simulated data for each custom field according to the business form of the target business service page and the attribute information of each custom field, and filling the field content of the corresponding custom field with the simulated data of each custom field, and generating a configuration file for the target business service page based on the filled custom fields; wherein, after the target source code is published, the configuration file is used to render the target business service page.
[0129] This application embodiment also provides a computer storage medium (memory), which is a memory device in a computer device used to store programs and data. It is understood that the computer storage medium here can include both the built-in storage medium in the computer device and extended storage media supported by the computer device. The computer storage medium provides storage space that stores the operating system of the computer device. Furthermore, this storage space also stores one or more instructions suitable for loading and execution by a processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer storage medium here can be high-speed RAM or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer storage medium located remotely from the aforementioned processor. In one embodiment, the processor can load and execute one or more instructions stored in the computer storage medium to implement the above-mentioned... Figure 2 or Figure 4 The various method steps in the embodiments of the data processing method shown.
[0130] This application embodiment can obtain the target source code of the target business service page, each model field in the target source code, and the attribute information of each model field. This facilitates the subsequent creation of custom fields corresponding to each model field and the attribute information of each custom field based on the obtained content. Specifically, it creates one or more custom fields for the target business service page and their attribute information. After creating each custom field and its attribute information, simulated data for each custom field can be determined based on the business form of the target business service page and the attribute information of each custom field. The simulated data is then used to populate the content of the corresponding custom fields, automatically retrieving the content of each custom field and effectively avoiding situations where the content of custom fields is not populated. Then, a configuration file for the target business service page can be generated based on the populated custom fields, thus conveniently obtaining the configuration file used to render the target business service page. Therefore, this application embodiment can quickly obtain the configuration file used to render the target business service page, solving the problem of manually configuring and verifying custom fields and project fields (i.e., model fields), thereby saving labor costs. In addition, this invention resolves the risk of errors and business risks during project requirement generation and release caused by manually created custom fields not being filled in. In other words, the content of each custom field in the configuration file obtained through this application embodiment is filled in, which can effectively avoid the risk of errors and business risks caused by configuration file errors during project requirement generation and release.
[0131] It should be noted that, according to one aspect of this application, a computer program product or computer program is also provided, which includes computer instructions stored in a computer storage medium. The processor of a computer device reads the computer instructions from the computer storage medium, executes the computer instructions, and causes the computer device to perform the aforementioned actions. Figure 2 ,or Figure 4 The methods provided in various alternative ways in the embodiments of the data processing method shown are as follows.
[0132] Furthermore, it should be understood that the above-disclosed embodiments are merely preferred embodiments of this application and should not be construed as limiting the scope of this application. Therefore, any equivalent variations made in accordance with the claims of this application are still within the scope of this application.
Claims
1. A data processing method, characterized in that, include: Obtain the target source code of the target business service page, and the field analysis results of the target source code; The field analysis results include each model field extracted from the target source code and the attribute information of each model field. The model field refers to the code field that supports data modification. The field analysis result is obtained by the target code device calling the code analysis script file in the code inspection hook function when it detects a submission trigger event for the target source code, and performing model field analysis processing on the target source code. The target code device is the device that generates the target source code. Based on the target source code and the field analysis results, create one or more custom fields for the target business service page and attribute information for each custom field; wherein, one custom field corresponds to one model field, and a custom field is a field for which no field content is specified; Based on the business type of the target business service page and the attribute information of each custom field, simulated data for each custom field is determined. The simulated data for any custom field is obtained from the dataset corresponding to the business type and matches the attribute information of the corresponding custom field. The simulated data of each custom field is used to fill the field content of the corresponding custom field, and the configuration file of the target business service page is generated based on the filled custom fields. After the target source code is released, the configuration file is used to render the target business service page.
2. The method according to claim 1, characterized in that, The acquisition of the target source code of the target business service page, and the field analysis results of the target source code, include: Receive code information submitted by the target code device; The code information includes: the target source code and the field analysis results of the target source code.
3. The method according to claim 2, characterized in that, The target source code includes multiple parameter acquisition requests, each parameter acquisition request corresponds to an object structure, and each parameter acquisition request includes a request address; The methods for calling the code analysis script file to analyze and process the model fields of the target source code and obtaining the field analysis results include: Iterate through each parameter retrieval request in the target source code and determine the current parameter retrieval request being iterated over. Search for target keywords in the request addresses included in the current parameter retrieval request. The target keywords refer to code identifiers used to indicate that field modification is permitted. If the target keyword is found, the object structure corresponding to the current parameter retrieval request will be used as a model field.
4. The method according to claim 3, characterized in that, The method further includes: If the target keyword is found, then the address suffix identifier of the request address in the current parameter retrieval request is determined; The determined address suffix identifier is used as the attribute information of the model field corresponding to the current parameter to obtain the request.
5. The method according to claim 2, characterized in that, The method further includes: In response to a login request sent by the target code device, the target code device is authenticated based on the access credential information carried in the login request; After the target code device passes the authentication, a successful login notification is returned to the target code device to notify the target code device to submit code information; wherein, the code information also includes access credential information; Upon receiving the code information, the reliability of the code information is verified based on the access credentials information in the code information. After the code information passes the reliability verification, the step of creating one or more custom fields and attribute information of each custom field for the target business service page based on the target source code and the field analysis results is triggered.
6. The method according to claim 1, characterized in that, The step of determining simulated data for each custom field based on the business type of the target business service page and the attribute information of each custom field includes: Based on the custom fields and corresponding attribute information, pattern processing is performed to obtain one or more patterns. A pattern includes at least one custom field and corresponding attribute information. Using various modes and the business form of the target business service page, a data acquisition request is generated and sent to the business system database, so that the business system database returns simulated data of each custom field according to the business form and the various modes; Receive simulated data for each custom field returned by the database of the business system.
7. The method according to claim 1, characterized in that, The step of generating the configuration file for the target business service page based on the populated custom fields includes: The configuration data corresponding to each of the populated custom fields is transformed using the template engine syntax of the hypertext preprocessor to obtain the configuration file.
8. A data processing apparatus, characterized in that, include: The acquisition unit is used to acquire the target source code of the target business service page, as well as the field analysis results of the target source code; The field analysis results include each model field extracted from the target source code and the attribute information of each model field. The model field refers to the code field that supports data modification. The field analysis result is obtained by the target code device calling the code analysis script file in the code inspection hook function when it detects a submission trigger event for the target source code, and performing model field analysis processing on the target source code. The target code device is the device that generates the target source code. The processing unit is used to create one or more custom fields and attribute information of each custom field for the target business service page based on the target source code and the field analysis results; wherein, one custom field corresponds to one model field, and a custom field is a field whose content is not specified. The processing unit is further configured to determine the simulated data of each custom field based on the business type of the target business service page and the attribute information of each custom field, wherein the simulated data of any custom field is obtained from the dataset corresponding to the business type and matches the attribute information of the corresponding custom field; and to fill the field content of the corresponding custom field with the simulated data of each custom field, and generate the configuration file of the target business service page based on the filled custom fields. After the target source code is released, the configuration file is used to render the target business service page.
9. A computer device, characterized in that, It includes a processor and a memory, wherein the memory is used to store a computer program, which, when executed by the processor, implements the method as described in any one of claims 1-7.
10. A computer storage medium, characterized in that, The computer storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method as described in any one of claims 1-7.
Citation Information
Patent Citations
Analog data generation method, device and equipment and computer readable storage medium
CN110221858A
Page processing method, device and equipment and storage medium
CN111177613A