A method of code processing and related apparatus
Patent Information
- Application Number
- CN202210335021.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-31
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2042-03-31
AI Technical Summary
但是,在查询过程中,需要在企业代码管理系统中输入关键字来检索,但是对于大型的网络(web)应用的多应用代码工程的查询场景来说,该现有方式的查询效率比较低下
[0018]本申请实施例中,目标对象欲想定位出显示在第一展示页面上的目标应用所对应的代码仓库地址,可以通过终端设备向服务器发送第一请求消息。而且由于代码仓库信息与应用已经预先关联,因此服务器在接收到该第一请求消息后,查找与该目标应用所对应的代码仓库信息,而且代码仓库信息包括该目标应用的代码仓库地址。然后,服务器向终端设备发送第一反馈消息,使得终端设备在接收到该第一反馈消息后,可以在第一展示页面上显示该目标应用的代码仓库地址。这样,目标对象可以在第一展示页面上查看到目标应用,也能够查看到对应的代码仓库地址,无需通过与代码相关的关键字等信息查找,提升了查询效率,并提高了后续代码维护过程中的处理效率。
Smart Images

Figure CN116932023B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, specifically to a method and related apparatus for code processing. Background Technology
[0002] In recent years, with the continuous updating and development of network technology, target users and developers increasingly hope to be able to quickly locate the corresponding code repositories of different applications, so as to facilitate subsequent maintenance and processing of different applications.
[0003] However, current solutions typically involve splitting different products into different applications, each with its own front-end codebase. Different tags or descriptions are then used to label the code for each application, facilitating subsequent code searches. However, this process requires entering keywords into an enterprise code management system, which is inefficient for searching large-scale web applications with multiple application codebases. Furthermore, if certain keywords or descriptions are not well-maintained, the corresponding code repository may not be found, making it impossible to locate the repository and hindering subsequent maintenance efficiency. Summary of the Invention
[0004] This application provides a method and related apparatus for code processing, enabling the target object to view the target application and the corresponding code repository address on a first display page, thereby improving query efficiency and processing efficiency in subsequent code maintenance.
[0005] In a first aspect, embodiments of this application provide a code processing method. This method is applied to a terminal device. The method includes: sending a first request message to a server, the first request message instructing the server to find and display code repository information corresponding to a target application on a first display page, wherein the display style of the target application on the first display page is the same as that on a second display page, the first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device; receiving a first feedback message sent by the server, the first feedback message including code repository information corresponding to the target application, the code repository information including the code repository address of the target application; and displaying the code repository address of the target application on the first display page.
[0006] Secondly, embodiments of this application provide another method for code processing. This method can be applied in a server. The method may include: receiving a first request message sent by a terminal device; searching for and displaying code repository information corresponding to a target application on a first display page based on the first request message, wherein the display style of the target application on the first display page is the same as that on a second display page, the first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device; sending a first feedback message to the terminal device, the first feedback message including code repository information corresponding to the target application, the code repository information including the code repository address of the target application, so that the terminal device displays the code repository address of the target application on the first display page.
[0007] A third aspect of this application provides a terminal device. The terminal device may include a sending unit, a receiving unit, and a processing unit. The sending unit is configured to send a first request message to a server, the first request message instructing the server to find and display the code repository information corresponding to a target application on a first display page. The display style of the target application on the first display page is the same as that on a second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device. The receiving unit is configured to receive a first feedback message sent by the server, the first feedback message including the code repository information corresponding to the target application, the code repository information including the code repository address of the target application. The processing unit is configured to display the code repository address of the target application on the first display page.
[0008] In one possible design, the receiving unit is further configured to receive a list of code repositories sent by the server, the list including at least one code repository. The sending unit is further configured to send to the server an application identifier for each application in at least one application, and a repository identifier for each code repository in at least one code repository, so that the server associates the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier based on the application identifier and the repository identifier, wherein at least one application includes the target application.
[0009] In another possible embodiment, the sending unit is further configured to send an access request for the second display page to the server before sending the first request message to the server. The access request instructs the server to locate the Hypertext Markup Language (HTML) page source code file of the second display page. The receiving unit is further configured to receive the HTML page source code file sent by the server, the HTML page source code file including HTML component code for the application displayed on the second display page. The processing unit is further configured to render the application based on the HTML component code to generate a first display page for displaying the application.
[0010] In another possible embodiment, the HTML page source file also includes the address of the Cascading Style Sheets (CSS) file for the second display page. The processing unit is further configured to obtain the CSS file based on the CSS file address; and render the application based on the CSS file and HTML component code to generate a first display page for displaying the application.
[0011] Fourthly, embodiments of this application provide a server. The server includes a receiving unit, a processing unit, and a sending unit. The receiving unit is used to receive a first request message sent by a terminal device. The processing unit is used to locate and display the code repository information corresponding to a target application on a first display page based on the first request message. The display style of the target application on the first display page is the same as that on a second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device. The sending unit is used to send a first feedback message to the terminal device. The first feedback message includes the code repository information corresponding to the target application, and the code repository information includes the code repository address of the target application, so that the terminal device displays the code repository address of the target application on the first display page.
[0012] In one possible embodiment, the sending unit is further configured to send a code repository list to the terminal device before searching for code repository information corresponding to the target application on the first display page according to the first request message. The code repository list includes at least one code repository. The receiving unit is further configured to receive an application identifier of each application in at least one application and a repository identifier of each code repository in at least one code repository, sent by the terminal device. The at least one application includes the target application. The processing unit is further configured to perform association processing on the application identified by the application identifier and the code repository information in the code repository identified by the repository identifier, based on the application identifier of each application and the repository identifier of each code repository.
[0013] In another possible embodiment, the receiving unit is further configured to receive an access request for the second display page sent by the terminal device before receiving the first request message sent by the terminal device. The processing unit is further configured to locate the Hypertext Markup Language (HTML) page source code file of the second display page based on the access request. The sending unit is further configured to send the HTML page source code file to the terminal device, the HTML page source code file including HTML component code of the application displayed on the second display page, the HTML component code being used by the terminal device to generate a first display page for displaying the application.
[0014] A fifth aspect of this application provides a code processing apparatus, including: a memory, a transceiver, a processor, and a bus system. The bus system connects the memory and the processor to enable communication between them. The memory stores a program. The processor executes the program in the memory to perform the method corresponding to the first aspect or any possible implementation thereof, or to perform the method corresponding to the second aspect or any possible implementation thereof.
[0015] A sixth aspect of this application provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method corresponding to the first aspect or any possible implementation thereof, or to perform the method corresponding to the second aspect or any possible implementation thereof.
[0016] The seventh aspect of this application provides a computer program product containing instructions that, when run on a computer or processor, causes the computer or processor to execute the method corresponding to the first aspect or any possible implementation thereof, or to execute the method corresponding to the second aspect or any possible implementation thereof.
[0017] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0018] In this embodiment, if a target object wishes to locate the code repository address corresponding to the target application displayed on the first display page, it can send a first request message to the server via a terminal device. Since the code repository information is pre-associated with the application, upon receiving the first request message, the server searches for the code repository information corresponding to the target application, including the code repository address of the target application. Then, the server sends a first feedback message to the terminal device, enabling the terminal device to display the code repository address of the target application on the first display page upon receiving the first feedback message. In this way, the target object can view both the target application and its corresponding code repository address on the first display page, eliminating the need to search using code-related keywords or other information, thus improving query efficiency and subsequent code maintenance efficiency. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 A schematic diagram of the query code in the relevant scheme is shown;
[0021] Figure 2 This diagram illustrates a query scenario for the code projects of multiple applications within a large web application.
[0022] Figure 3 This illustration shows a schematic diagram of a system framework provided in an embodiment of this application;
[0023] Figure 4 A flowchart of a data transmission method provided in an embodiment of this application is shown;
[0024] Figure 5 The illustration shown is a schematic diagram of the first display page provided in an embodiment of this application;
[0025] Figure 6 This illustration shows a schematic diagram of maintaining a code repository on a first display page, according to an embodiment of this application.
[0026] Figure 7 This illustration shows a schematic diagram of how the code repository address is displayed on the first display page, according to an embodiment of this application.
[0027] Figure 8 Another flowchart of the code processing method provided in the embodiments of this application is shown;
[0028] Figure 9 A schematic diagram of the structure of the terminal device provided in an embodiment of this application is shown;
[0029] Figure 10 A schematic diagram of the server structure provided in an embodiment of this application is shown;
[0030] Figure 11 A schematic diagram of the structure of the code processing apparatus provided in an embodiment of this application is shown. Detailed Implementation
[0031] This application provides a method and related apparatus for code processing, enabling the target object to view the target application and the corresponding code repository address on a first display page, thereby improving query efficiency and processing efficiency in subsequent code maintenance.
[0032] It is understood that in the specific embodiments of this application, data such as user information are involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0033] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0034] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that implementations of the application described herein can be implemented, for example, in sequences other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] The code processing method provided in this application is based on cloud technology. Cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, and networks within a wide area network or local area network to realize data computation, storage, processing, and sharing.
[0036] Cloud technology is a general term encompassing network technology, information technology, integration technology, management platform technology, and application technology based on cloud computing business models. It can form resource pools, providing flexible and convenient on-demand access. Cloud computing technology will become a crucial support. Backend services of technical network systems require substantial computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, every item may have its own identification mark in the future, requiring transmission to backend systems for logical processing. Data at different levels will be processed separately, and various industry data will all require robust system support, all of which can be achieved through cloud computing.
[0037] Cloud computing is a computing model that distributes computing tasks across a resource pool composed of a large number of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, the resources in the "cloud" are infinitely scalable, readily available, on-demand, expandable, and pay-as-you-go.
[0038] As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established. Various types of virtual resources are deployed in the resource pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices.
[0039] Based on logical function, a Platform as a Service (PaaS) layer can be deployed on top of the Infrastructure as a Service (IaaS) layer, and a Software as a Service (SaaS) layer can be deployed on top of the PaaS layer. Alternatively, SaaS can be deployed directly on top of IaaS. PaaS is the platform on which software runs, such as databases and web containers. SaaS refers to various types of business software, such as web portals and bulk SMS senders. Generally speaking, SaaS and PaaS are upper layers compared to IaaS.
[0040] With the continuous development of network technology, target users want to quickly locate the code repositories of different applications to facilitate subsequent maintenance. However, current solutions typically involve splitting different products into different applications, each with its own front-end code project, and labeling the code for each application with different tags or descriptions to facilitate code retrieval. For example, Figure 1 A schematic diagram of the query code in the relevant scheme is shown. For example... Figure 1 As shown, in an enterprise code management system, each code project has a corresponding code name, Git address, description, and tags. When searching, the target object typically needs to enter code-related keywords (such as: Vue, JavaScript, framework, and Frontend). The server then uses these keywords to determine if they match the code name, description, or tags. If a keyword matches one or more of these criteria, the code search is complete.
[0041] Figure 2 This diagram illustrates a query scenario involving the codebase of multiple applications within a large web application. For example... Figure 2 As shown, this large web application can be broken down into multiple applications, including but not limited to: computing, basic storage services, networking, and data storage services. The process of querying the codebase of each application must be done through... Figure 1 The existing query methods shown make the query process cumbersome and inefficient. Furthermore, if certain keywords or descriptions are not well-maintained, it may be impossible to find the corresponding code repository, thus hindering the location of the repository and reducing the efficiency of subsequent maintenance processes.
[0042] Therefore, in order to solve the technical problems described above, embodiments of this application provide a code processing method. The code processing method provided by this application can be applied to... Figure 3 In the system architecture shown. For example... Figure 3 As shown, the system architecture includes a terminal device and a server. If a target object wants to locate the code repository address corresponding to the target application displayed on the first display page, it can send a first request message to the server through the terminal device. Furthermore, since the code repository information is already associated with the application, the server, upon receiving the first request message, can search for the code repository information corresponding to the target application, including the code repository address of the target application. Therefore, the server can send a first feedback message to the terminal device, enabling the terminal device to display the code repository address of the target application on the first display page. This allows the target object to view both the target application and its corresponding code repository address on the first display page, improving query efficiency and enhancing processing efficiency during subsequent code maintenance.
[0043] It should be noted that the terminal devices mentioned above may include, but are not limited to, smartphones, desktop computers, laptops, tablets, smart speakers, in-vehicle devices, smartwatches, foldable electronic devices, laptops, handheld devices, netbooks, personal digital assistants (PDAs), artificial intelligence (AI) devices, intelligent voice interaction devices, smart home appliances, aircraft, wearable devices, or other processing devices connected to wireless modems, as well as various forms of user equipment (UE), mobile stations (MS), etc. Servers may be independent physical servers, server clusters or distributed systems composed of multiple physical servers, or cloud servers providing basic cloud computing services such as cloud computing, cloud services, cloud databases, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. This application does not impose specific limitations. Furthermore, the mentioned terminal devices and servers may be directly or indirectly connected via wired or wireless communication, which is also not specifically limited in this application.
[0044] Figure 4 A flowchart illustrating a code processing method provided in an embodiment of this application is shown. Figure 4 As shown, the method of processing this code may include the following steps:
[0045] 401. The terminal device sends the first request message to the server.
[0046] In this example, since the server stores the code repository address corresponding to each application, if a target object wants to locate the code repository address corresponding to the target application displayed on the first display page, it can send a first request message to the server through the terminal device. For example, the first request message may also include the application identifier of the target application, etc.
[0047] It should be noted that the described first display page can be understood as the application display page on the terminal device used to display applications. At least one application can be displayed on this first display page. Furthermore, the described target application can be one or more applications among at least one application; this application does not specifically limit the scope. Additionally, the mentioned application can be understood as a functional module capable of performing certain functions or providing certain services, such as the aforementioned... Figure 2The computing, basic storage services, network, and data storage services shown in the diagram are not specifically limited in this application. Furthermore, the code repository address can be used to indicate the location where the application is stored in the corresponding code repository. By calling this code repository address, the corresponding code repository can be found clearly and quickly, thereby obtaining the target application.
[0048] In some optional examples, since the application display page serves as the medium for the target object to interact with various applications, and the target object wants to quickly obtain the code repository addresses of various applications through the terminal device in a large-scale web query scenario, it first needs to render a display page consistent with the application display method in the control and management device. Based on this, before sending the first request message to the server, the terminal device can also perform the following steps: send an access request to the server for the second display page, the access request instructing the server to find the Hypertext Markup Language (HTML) page source code file of the second display page; receive the HTML page source code file sent by the server, the HTML page source code file including the HTML component code of the application displayed on the second display page; and render the application according to the HTML component code to generate the first display page for displaying the application.
[0049] In this example, the terminal device can first send an access request to the server for the second display page, which includes the attribute information of the second display page. It should be noted that the second display page can be understood as the application display page used by the control and management device to display applications. At least one application can be displayed on this second display page. Furthermore, the described target application can be one or more applications from at least one application.
[0050] Additionally, the described access request can be a Uniform Resource Locator (URL). The attribute information of the second display page may include information such as the protocol, domain name, path, and filename on which the second display page is based; this application does not impose specific limitations on this. Furthermore, the described filename can be used to indicate an HTML page source file.
[0051] Furthermore, since the server stores the HTML page source code file corresponding to the attribute information of the second display page, upon receiving an access request from the terminal device, the server can parse the attribute information of the second display page, obtain the HTML page source code file based on the attribute information, and then send the HTML page source code file to the terminal device. It should be noted that the HTML page source code file includes the HTML page source code and the application created by the developers on the page template when developing the second display page. In other words, the HTML page source code file includes the HTML component code of the application displayed on the second display page.
[0052] In this way, after receiving the HTML page source code file sent by the server, the terminal device parses the HTML page source code file to obtain the HTML component code of the application displayed on the second display page. Then, the terminal device can render the application based on the HTML component code, thereby generating the first display page, which completely reproduces the display method of each application on the second display page. For details, please refer to... Figure 5 The diagram shown on the first display page is for reference.
[0053] It should be noted that each application in at least one application is displayed in the same way on the first display page as on the second display page, which facilitates finding the application on the same display page later.
[0054] In some alternative examples, the HTML page source file also includes the address of the cascading style sheets (CSS) file for the second display page. Based on this, rendering the application according to the HTML component code to generate the first display page for showing the application can be achieved by: obtaining the CSS file based on the CSS file address; and rendering the application based on the CSS file and the HTML component code to generate the first display page for showing the application.
[0055] In this example, after parsing the HTML page source code file, the terminal device can obtain the HTML component code and the CSS file address. Then, the terminal device can retrieve the CSS file based on the CSS file address and load it. The terminal device can detect whether the CSS file has finished loading; if it does, it renders the application based on the HTML component code and the CSS file, thus generating the first display page.
[0056] In this way, after the first display page is generated, when the target object wants to locate the code repository address corresponding to the target application displayed on the first display page, it can send a first request message to the server through the terminal device.
[0057] 402. The server searches for and displays the code repository information corresponding to the target application on the first display page according to the first request message. The display style of the target application on the first display page is the same as that on the second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device.
[0058] In this example, after the terminal device sends a first request message to the server, the server can receive the first request message. At this point, the server can obtain the application identifier of the target application by parsing the first request message. Furthermore, the server has pre-associated each application in the first display page with its corresponding code repository information. In addition, the server maintains a list of code repositories, which includes at least one code repository, and stores corresponding code repository information for each repository.
[0059] Therefore, after obtaining the application identifier of the target application, the server can find the corresponding code repository based on the application identifier of the target application, and then obtain the code repository information in the corresponding code repository.
[0060] In some optional examples, before the server searches for the code repository information corresponding to the target application on the first display page based on the first request message, it may first perform the following steps: send a code repository list to the terminal device, the code repository list including at least one code repository; receive the application identifier of each application in at least one application and the repository identifier of each code repository in at least one code repository sent by the terminal device, the at least one application including the target application; and perform association processing on the application identified by the application identifier and the code repository information in the code repository identified by the repository identifier based on the application identifier of each application and the repository identifier of each code repository.
[0061] In this example, the target object can maintain the corresponding code repository address for each application on the first display page. Therefore, the target object can use the terminal device to call the corresponding interface to obtain the relevant code repository list from the server, and then edit or add the corresponding code repository on the first display page. For example, Figure 6 This illustrates how a code repository is maintained on the first display page. Figure 6As shown, after receiving the list of code repositories sent by the server, the terminal device can first draw a pop-up window using HTML and CSS rendering algorithms. Then, by searching for the code project name corresponding to any code repository in the pop-up window (e.g., "test", "test1"), the device can edit or add the corresponding code repository on the first display page. It should be noted that the described list of code repositories includes at least one code repository.
[0062] After maintaining the code repository on the first display page, the terminal device can also send the application identifier of each application and the repository identifier of each code repository in the code repository list to the server. In this way, after the server obtains the application identifier of each application and the repository identifier of each code repository, it can associate the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier, and save the corresponding association in the database. This makes it easy to query the corresponding code repository information based on the application identifier of the target application in the future.
[0063] 403. The server sends a first feedback message to the terminal device. The first feedback message includes the code repository information corresponding to the target application. The code repository information includes the code repository address of the target application.
[0064] In this example, after the server locates the code repository information corresponding to the target application, it can include this code repository information in the first feedback message. Then, the server can send this first feedback message to the terminal device by calling the repository information interface corresponding to the target application.
[0065] It should be noted that for any given application, the server can store the corresponding code repository. Therefore, the code repository information for the target application can include the code repository address of the target application. The code repository address can be used to locate which code repository the target application is stored in.
[0066] 404. The terminal device displays the code repository address of the target application on the first display page.
[0067] In this example, after receiving the first feedback message from the server, the terminal device can parse the message to obtain the code repository information corresponding to the target application. At this point, the terminal device can display the repository code address of the target application on the first display page.
[0068] For example, the way the repository code address is displayed can include, but is not limited to, one or more of the following: Hypertext Transfer Protocol (HTTP) display method and SSH (Spring + Struts + Hibernate) display method. It should be noted that the SSH display method can be understood as the display method of the three frameworks in Java EE. For example... Figure 7 As shown, the target application's code repository address is displayed via HTTP, such as http: / / xxxx.git. The target application's diam repository address is displayed via SSH, such as http: / / git@xxx:xx.git. This application does not specify further details.
[0069] In other examples, the terminal device also provides a corresponding address copying function for the code repository address of each application. This address copying function can easily copy the code repository address, making it convenient for developers to quickly obtain the corresponding code repository address from the first display page.
[0070] Figure 8 Another flowchart of the code processing method provided in this application embodiment is shown. Figure 8 As shown, the method of processing this code may include the following steps:
[0071] 801. The terminal device sends an access request to the server for the second display page.
[0072] In this example, the application display page serves as the medium for the target object to interact with various applications. Furthermore, since the target object wants to quickly obtain the code repository addresses of various applications through the terminal device in a large-scale web query scenario, the terminal device can first render a display page consistent with the application display method in the control and management device. Therefore, the terminal device can send an access request to the server for the second display page. For example, this access request may include the attribute information of the second display page. Additionally, the attribute information of the second display page may include information such as the protocol, domain name, path, and filename on which the second display page is based; this application does not impose specific limitations on these details.
[0073] It should be noted that the second display page described in the embodiments of this application can be referred to the foregoing. Figure 4 The content of the second display page in step 401 will be understood and will not be repeated here. Additionally, the described access request...
[0074] 802. The server searches for the source code file of the Hypertext Markup Language (HTML) page of the second display page based on the access request.
[0075] In this example, because the server stores the HTML page source code file corresponding to the attribute information of the second display page, the server can parse the attribute information of the second display page after receiving the access request from the terminal device, and then obtain the HTML page source code file based on the attribute information of the second display page.
[0076] 803. The server sends an HTML page source code file to the terminal device. The HTML page source code file includes the HTML component code of the application displayed on the second display page.
[0077] In this example, after obtaining the HTML page source code file, the server can send the HTML page source code file to the terminal device. It should be noted that the HTML page source code file includes the HTML page source code and the application created by the developers on the page template when developing the second display page. In other words, the HTML page source code file includes the HTML component code of the application displayed on the second display page.
[0078] For example, the server may also send the HTML page source code file to the terminal device through feedback messages or other means; this application does not make any specific limitations.
[0079] 804. The terminal device renders the application according to the HTML component code to generate a first display page for displaying the application. The display style of the target application on the first display page is the same as that on the second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device.
[0080] In this example, after receiving the HTML page source code file sent by the server, the terminal device parses the HTML page source code file to obtain the HTML component code of the application displayed on the second display page. Then, the terminal device can render the application based on the HTML component code, thereby generating the first display page and completely restoring the display method of each application in the second display page.
[0081] It should be noted that the first display page described in the embodiments of this application can also be referred to the foregoing. Figure 4 We will understand the content of the first display page in step 401, which will not be repeated here.
[0082] 805. The server sends a list of code repositories to the terminal device. The list of code repositories includes at least one code repository.
[0083] In this example, the target object can maintain the corresponding code repository address for each application on the first display page. Therefore, the target object can call the corresponding interface through the terminal device to obtain the corresponding code repository list from the server, and then edit or add the corresponding code repository on the first display page.
[0084] In some optional examples, the terminal device can also send a request message to the server, instructing the server to retrieve a list of code repositories from the database. The server then returns this list of code repositories to the terminal device.
[0085] 806. The terminal device sends to the server the application identifier of each application in at least one application and the repository identifier of each code repository in at least one code repository, wherein at least one application includes the target application.
[0086] In this example, after receiving the list of code repositories sent by the server, the terminal device can maintain the code repositories on the first display page. It can then send the application identifier for each application and the repository identifier for each code repository in the list to the server.
[0087] It should be noted that the application identifier can be used to identify the corresponding application, and the repository identifier can be used to identify the corresponding code repository.
[0088] 807. The server associates the application identified by the application identifier with the code repository information in the code repository identified by the code repository identifier, based on the application identifier of each application and the repository identifier of each code repository.
[0089] In this example, after the server obtains the application identifier of each application and the repository identifier of each code repository sent by the terminal device, it can associate the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier, and save the corresponding association in the database, so that the corresponding code repository information can be queried based on the application identifier of the target application in the future.
[0090] 808. The terminal device sends a first request message to the server. The first request message is used to instruct the server to find and display the code repository information corresponding to the target application on the first display page.
[0091] In this example, since the server stores the code repository address corresponding to each application, if a target object wants to locate the code repository address corresponding to the target application displayed on the first display page, it can send a first request message to the server through the terminal device. For example, the first request message may also include the application identifier of the target application, etc.
[0092] 809. The server searches for and displays the code repository information corresponding to the target application on the first display page based on the first request message.
[0093] In this example, after the terminal device sends a first request message to the server, the server can receive the first request message. At this point, the server can obtain the application identifier of the target application by parsing the first request message. Furthermore, the server has pre-associated each application in the first display page with its corresponding code repository information. In addition, the server maintains a list of code repositories, which includes at least one code repository, and stores corresponding code repository information for each repository.
[0094] Therefore, after obtaining the application identifier of the target application, the server can find the corresponding code repository based on the application identifier of the target application, and then obtain the code repository information in the corresponding code repository.
[0095] 810. The server sends a first feedback message to the terminal device. The first feedback message includes the code repository information corresponding to the target application. The code repository information includes the code repository address of the target application.
[0096] In this example, after the server locates the code repository information corresponding to the target application, it can include this information in the first feedback message. Then, the server can send this first feedback message to the terminal device by calling the repository information interface corresponding to the target application. Furthermore, the code repository information also includes the code repository address of the target application. Therefore, after sending this first feedback message to the terminal device, the server can also send the code repository address of the target application to the terminal device via this first feedback message.
[0097] 811. The terminal device displays the code repository address of the target application on the first display page.
[0098] In this example, since the target application's code repository address is carried in the first feedback message, after the server sends the first feedback message to the terminal device, the terminal device can parse the first feedback message to obtain the corresponding repository code information, and thus obtain the target application's code repository address. In this way, the terminal device can display the target application's repository code address on the first display page.
[0099] For example, the method of displaying the code repository address can be referred to the foregoing. Figure 4 The content of step 404 in the previous section will be understood and will not be elaborated upon here.
[0100] In this embodiment, if a target object wishes to locate the code repository address corresponding to the target application displayed on the first display page, it can send a first request message to the server via a terminal device. Since the code repository information is pre-associated with the application, upon receiving the first request message, the server searches for the code repository information corresponding to the target application, including the code repository address of the target application. Then, the server sends a first feedback message to the terminal device, enabling the terminal device to display the code repository address of the target application on the first display page upon receiving the first feedback message. In this way, the target object can view both the target application and its corresponding code repository address on the first display page, eliminating the need to search using code-related keywords or other information, thus improving query efficiency and subsequent code maintenance efficiency.
[0101] The foregoing primarily describes the solutions provided by the embodiments of this application from a methodological perspective. It is understood that to achieve the above functions, corresponding hardware structures and / or software modules are included to execute each function. Those skilled in the art should readily recognize that, based on the modules and algorithm steps described in conjunction with the embodiments disclosed in this application, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0102] This application embodiment can divide the device into functional modules according to the above method example. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0103] The terminal device in the embodiments of this application will be described in detail below. Figure 9 This is a schematic diagram of one embodiment of the terminal device provided in this application. For example... Figure 9 As shown, the terminal device may include a transmitting unit 901, a receiving unit 902, and a processing unit 903.
[0104] The sending unit 901 is used to send a first request message to the server. The first request message is used to instruct the server to find and display the code repository information corresponding to the target application on the first display page. The display style of the target application on the first display page is the same as that on the second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device.
[0105] The receiving unit 902 is used to receive a first feedback message sent by the server. The first feedback message includes code repository information corresponding to the target application, and the code repository information includes the code repository address of the target application.
[0106] Processing unit 903 is used to display the code repository address of the target application on the first display page.
[0107] In one possible design, the receiving unit 902 is further configured to receive a list of code repositories sent by the server, the list including at least one code repository. The sending unit 901 is further configured to send to the server an application identifier for each application in at least one application, and a repository identifier for each code repository in at least one code repository, so that the server associates the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier based on the application identifier and the repository identifier, wherein at least one application includes the target application.
[0108] In another possible embodiment, the sending unit 901 is further configured to send an access request for the second display page to the server before sending the first request message to the server. The access request instructs the server to locate the Hypertext Markup Language (HTML) page source code file of the second display page. The receiving unit 902 is further configured to receive the HTML page source code file sent by the server, the HTML page source code file including HTML component code for the application displayed on the second display page. The processing unit 903 is further configured to render the application based on the HTML component code to generate a first display page for displaying the application.
[0109] In another possible embodiment, the HTML page source file also includes the address of the Cascading Style Sheets (CSS) file for the second display page. The processing unit 903 is further configured to obtain the CSS file based on the CSS file address; and render the application based on the CSS file and HTML component code to generate a first display page for displaying the application.
[0110] The server in the embodiments of this application will be described in detail below. Figure 10 This is a schematic diagram of one embodiment of the server provided in this application. For example... Figure 10As shown, the server may include a receiving unit 1001, a processing unit 1002, and a sending unit 1003.
[0111] The receiving unit 1001 is used to receive a first request message sent by the terminal device. The processing unit 1002 is used to search for and display the code repository information corresponding to the target application on the first display page according to the first request message. The display style of the target application on the first display page is the same as that on the second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device. The sending unit 1003 is used to send a first feedback message to the terminal device. The first feedback message includes the code repository information corresponding to the target application. The code repository information includes the code repository address of the target application, so that the terminal device displays the code repository address of the target application on the first display page.
[0112] In one possible embodiment, the sending unit 1003 is further configured to send a code repository list to the terminal device before searching for code repository information corresponding to the target application on the first display page according to the first request message. The code repository list includes at least one code repository. The receiving unit 1001 is further configured to receive an application identifier of each application in at least one application and a repository identifier of each code repository in at least one code repository sent by the terminal device. The at least one application includes the target application. The processing unit 1002 is further configured to perform association processing on the application identified by the application identifier and the code repository information in the code repository identified by the repository identifier, based on the application identifier of each application and the repository identifier of each code repository.
[0113] In another possible embodiment, the receiving unit 1001 is further configured to receive an access request for the second display page sent by the terminal device before receiving the first request message sent by the terminal device. The processing unit 1002 is further configured to locate the Hypertext Markup Language (HTML) page source code file of the second display page based on the access request. The sending unit 1003 is further configured to send the HTML page source code file to the terminal device, the HTML page source code file including HTML component code of the application displayed on the second display page, the HTML component code being used by the terminal device to generate a first display page for displaying the application.
[0114] The terminal device and server in the embodiments of this application have been described above from the perspective of modular functional entities. The terminal device and server in the embodiments of this application are described below from the perspective of hardware processing. Figure 11This is a schematic diagram of the structure of a code processing device provided in an embodiment of this application. The code processing device may include the terminal device and server described above. The code processing device may vary considerably due to differences in configuration or performance. The code processing device may include at least one processor 1101, a communication line 1107, a memory 1103, and at least one communication interface 1104.
[0115] The processor 1101 may be a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (server IC), or one or more integrated circuits used to control the execution of the program of the present application.
[0116] Communication line 1107 may include a path for transmitting information between the aforementioned components.
[0117] Communication interface 1104 uses any transceiver-like device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area network (WLAN), etc.
[0118] The memory 1103 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions. The memory can exist independently and be connected to the processor via communication line 1107. The memory can also be integrated with the processor.
[0119] The memory 1103 stores computer execution instructions for implementing the scheme of this application, and its execution is controlled by the processor 1101. The processor 1101 executes the computer execution instructions stored in the memory 1103, thereby implementing the code processing method provided in the above embodiments of this application.
[0120] Optionally, the computer execution instructions in the embodiments of this application may also be referred to as application code, and the embodiments of this application do not specifically limit this.
[0121] In a specific implementation, as one example, the computer device may include multiple processors, for example... Figure 11Processors 1101 and 1102 are described herein. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor here may refer to one or more devices, circuits, and / or processing cores used to process data (e.g., computer program instructions).
[0122] In a specific implementation, as one embodiment, the computer device may further include an output device 1105 and an input device 1106. The output device 1105 communicates with the processor 1101 and can display information in various ways. The input device 1106 communicates with the processor 1101 and can receive user input in various ways. For example, the input device 1106 may be a mouse, a touch screen device, or a sensing device, etc.
[0123] The aforementioned computer device can be a general-purpose device or a special-purpose device. In specific implementations, the computer device can be a microscope or something similar. Figure 11 A device with a similar structure. The embodiments of this application do not limit the type of computer device.
[0124] It should be noted that Figure 11 The processor 1101 can invoke computer execution instructions stored in memory 1103 to enable terminal devices and servers to perform tasks such as... Figure 4 or Figure 8 The method in the corresponding method embodiment.
[0125] Specifically, Figure 9 Processing unit 903 in Figure 10 The function / implementation process of the processing unit 1002 can be achieved through... Figure 11 The processor 1101 in the memory calls the computer execution instructions stored in the memory 1103 to implement it. Figure 9 The receiving unit 902 and the transmitting unit 901 in the middle Figure 10 The functions / implementation process of the receiving unit 1001 and the transmitting unit 1003 can be obtained through Figure 11 It is implemented using the communication interface 1104.
[0126] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0127] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0128] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.
[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0130] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0132] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, they can be implemented in whole or in part in the form of a computer program product.
[0133] A computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, they generate, in whole or in part, the processes or functions according to embodiments of this application. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions may be transmitted from one website, computer, server, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., SSDs), etc.
[0134] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. A method for code processing, characterized in that, Applied to a terminal device, the method includes: A first request message is sent to the server, instructing the server to find and display the code repository information corresponding to the target application on the first display page. The target application is displayed in the same style on the first display page as it is on the second display page. The first display page is the application display page for the terminal device, and the second display page is the application display page for the control and management device. The code repository information is pre-associated with the application. The association method is as follows: receiving a code repository list sent by the server, the code repository list including at least one code repository; sending the server an application identifier for each application in at least one application, and a repository identifier for each code repository in the at least one code repository, so that the server associates the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier based on the application identifier and the repository identifier. The at least one application includes the target application. Receive a first feedback message sent by the server, the first feedback message including code repository information corresponding to the target application, the code repository information including the code repository address of the target application; The code repository address of the target application is displayed on the first display page.
2. The method according to claim 1, characterized in that, Before sending the first request message to the server, the method further includes: Send an access request to the server for the second display page, the access request being used to instruct the server to locate the Hypertext Markup Language (HTML) page source code file of the second display page; The server receives the HTML page source code file, which includes HTML component code for the application displayed on the second display page. The application is rendered based on the HTML component code to generate a first display page for showing the application.
3. The method according to claim 2, characterized in that, The HTML page source code file also includes the address of the Cascading Style Sheets (CSS) file of the second display page; The step of rendering the application based on the HTML component code to generate a first display page for displaying the application includes: Obtain the CSS file based on the CSS file address; The application is rendered based on the CSS file and the HTML component code to generate a first display page for showing the application.
4. A method for code processing, characterized in that, Applied to a server, the method includes: Receive the first request message sent by the terminal device; The code repository information corresponding to the target application is searched and displayed on the first display page according to the first request message. The display style of the target application on the first display page is the same as that on the second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device. A first feedback message is sent to the terminal device. The first feedback message includes code repository information corresponding to the target application. The code repository information includes the code repository address of the target application. This enables the terminal device to display the code repository address of the target application on the first display page. The code repository information has been pre-associated with the application. The association method is as follows: a code repository list is sent to the terminal device, and the code repository list includes at least one code repository. The terminal device sends an application identifier for each application in at least one application and a repository identifier for each code repository in the at least one code repository. Based on the application identifier and the repository identifier, the application identified by the application identifier and the code repository information in the code repository identified by the repository identifier are associated. The at least one application includes the target application.
5. The method according to claim 4, characterized in that, Before the first request message sent by the receiving terminal device, the method further includes: Receive the access request for the second display page sent by the terminal device; Based on the access request, locate the source code file of the Hypertext Markup Language (HTML) page of the second display page; The HTML page source code file is sent to the terminal device. The HTML page source code file includes HTML component code for the application displayed on the second display page. The HTML component code is used by the terminal device to generate the first display page for displaying the application.
6. A terminal device, characterized in that, include: A sending unit is configured to send a first request message to a server, the first request message instructing the server to find and display the code repository information corresponding to the target application on a first display page. The target application is displayed in the same style on the first display page as it is on a second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device. The code repository information is pre-associated with the application, and the association method is as follows: receiving a code repository list sent by the server, the code repository list including at least one code repository; sending to the server an application identifier for each application in at least one application, and a repository identifier for each code repository in the at least one code repository, so that the server associates the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier based on the application identifier and the repository identifier. The at least one application includes the target application. A receiving unit is configured to receive a first feedback message sent by the server, the first feedback message including code repository information corresponding to the target application, the code repository information including the code repository address of the target application; The processing unit is configured to display the code repository address of the target application on the first display page.
7. A server, characterized in that, include: The receiving unit is used to receive the first request message sent by the terminal device; The processing unit is used to find and display the code repository information corresponding to the target application on the first display page according to the first request message. The display style of the target application on the first display page is the same as that on the second display page. The first display page is the application display page of the terminal device, and the second display page is the application display page of the control and management device. The sending unit is configured to send a first feedback message to a terminal device. The first feedback message includes code repository information corresponding to the target application. The code repository information includes the code repository address of the target application, so that the terminal device displays the code repository address of the target application on a first display page. The code repository information has been pre-associated with the application. The association method is as follows: a code repository list is sent to the terminal device, the code repository list including at least one code repository; the unit receives an application identifier of each application in at least one application and a repository identifier of each code repository in the at least one code repository sent by the terminal device; based on the application identifier and the repository identifier, the unit associates the application identified by the application identifier with the code repository information in the code repository identified by the repository identifier, wherein the at least one application includes the target application.
8. A code processing device, characterized in that, The code processing device includes: an input / output (I / O) interface, a processor, and a memory, wherein the memory stores program instructions; The processor is configured to execute the program instructions stored in the memory to perform the method as described in any one of claims 1 to 3 or 4 to 5.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 3, or 4 to 5.
10. A computer program product, characterized in that, The computer program product includes instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 3 or 4 to 5.
Citation Information
Patent Citations
Webpage rendering method, webpage making method and webpage rendering system
CN113326043A
Code query method and device of application program, equipment and storage medium
CN113656606A
Code search system generation method, code search method and search server
CN113806595A
