Source code data processing method and device, product, equipment and medium

By constructing and updating the source code resource package when the target source code branch is updated, and calling it directly in the source code call space, the problems of low source code resource call efficiency and high maintenance cost in the existing technology are solved, and more efficient and convenient program operation is achieved.

CN118733288APending Publication Date: 2024-10-01TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310352878.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-30
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the existing technology, when the client runs a specified program in a specific operating environment, it needs to configure relevant parameters and call source code resources through the proxy layer, resulting in low call efficiency, complexity, and high maintenance costs.

Method used

When the target source code branch is triggered to be updated, its source code resources are obtained, the source code resource package is constructed, and updated to the associated source code call space, supporting direct calls based on call information.

Benefits of technology

It improves the efficiency of calling source code resources, reduces the difficulty of calling, improves the convenience of running the program, and reduces the maintenance cost of the agent layer.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733288A_ABST
    Figure CN118733288A_ABST
Patent Text Reader

Abstract

The invention discloses a source code data processing method and device, a product, equipment and a medium, and the method comprises the steps: obtaining a source code resource in a target source code branch when the target source code branch of a program is triggered to update; the program has one or more source code branches, one source code branch corresponds to one running environment of the program, and the target source code branch is any one of the one or more source code branches; according to the source code resources in the target source code branch, constructing a source code resource packet used for running the program; updating the source code resource packet to a source code calling space associated with the target source code branch; the source code resource packet in the source code calling space supports calling based on calling information corresponding to the source code calling space so as to run the program in a running environment corresponding to the target source code branch. By adopting the application, the efficiency of calling the source code resource of the program can be improved, and the difficulty of calling the source code resource of the program is reduced, so that the convenience of running the program is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, product, equipment and medium for processing source code data. Background Art

[0002] When a client requests to run a specified program in a specific operating environment, it is usually necessary to configure relevant parameters in the request (such as the relevant parameters of the program in the specific operating environment) and forward the configured request to the proxy layer. The proxy layer calls the source code resources of the specified program to the corresponding server (the source code resources of the program in different environments are usually stored on different servers) based on the relevant parameters in the request and the pre-configured proxy rules, and gives the called source code resources to the client, so that the client can run the specified program through the acquired source code resources.

[0003] This method of configuring relevant parameters to let the proxy layer call source code resources has low efficiency in calling source code resources, and the calling process is also relatively complicated. In addition, the proxy layer used to call source code resources needs to be maintained, and the maintenance cost is also high. Therefore, how to conveniently and quickly call the source code resources of a program to realize the operation of the program is a hot issue at present. Summary of the invention

[0004] The present application provides a method, apparatus, product, device and medium for processing source code data, which can improve the efficiency of calling the source code resources of a program and reduce the difficulty of calling the source code resources of a program, thereby improving the convenience of running the program.

[0005] On the one hand, the present application provides a method for processing source code data, the method comprising:

[0006] When the target source code branch of the program is triggered to update, the source code resources in the target source code branch are obtained; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches;

[0007] Build a source code resource package for running the program based on the source code resources in the target source code branch;

[0008] The source code resource package is updated to the source code call space associated with the target source code branch; the source code resource package in the source code call space supports calling based on the calling information corresponding to the source code call space, so as to run the program in the running environment corresponding to the target source code branch.

[0009] On one hand, the present application provides a source code data processing device, the device comprising:

[0010] The trigger module is used to obtain the source code resources in the target source code branch when the target source code branch of the program is triggered to be updated; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches;

[0011] A building module is used to build a source code resource package for running the program based on the source code resources in the target source code branch;

[0012] The calling module is used to update the source code resource package to the source code calling space associated with the target source code branch; the source code resource package in the source code calling space supports calling based on the calling information corresponding to the source code calling space, so as to run the program in the running environment corresponding to the target source code branch.

[0013] Optionally, the target source code branch is triggered to update in any of the following ways:

[0014] The source code resources in the target source code branch are changed, the source code resources in the target source code branch are changed a specified number of times, or the source code call space associated with the target source code branch has not been updated for a period greater than or equal to the duration of the update cycle.

[0015] Optionally, the building module builds a source code resource package for running the program based on the source code resources in the target source code branch, including:

[0016] Get the entry source code resources in the target source code branch; the entry source code resources are used to start the program;

[0017] Based on the entry source code resource, M source code resources with a reference relationship in the target source code branch are obtained; the M source code resources include the entry source code resource, any source code resource in the M source code resources has a reference relationship with at least one other source code resource in the M source code resources, and M is a positive integer;

[0018] Build a source code resource package based on M source code resources.

[0019] Optionally, the source code call space belongs to the storage space in the source code repository; the process of the above device generating the call information includes:

[0020] Obtain addressing information of the source code repository and obtain identification information of the source code call space;

[0021] Generate a call link based on the addressing information and the identification information;

[0022] Among them, the call link belongs to the call information.

[0023] Optionally, the above device is also used for:

[0024] Receive the call link sent by the client, and parse the call link to obtain addressing information and identification information;

[0025] Locating the source code repository based on the addressing information, and calling the source code resource package in the source code calling space of the located source code repository based on the identification information;

[0026] The called source code resource package is returned to the client, so that the client can run the program based on the source code resource package in the running environment corresponding to the target source code branch.

[0027] Optionally, the client is a web client and the program is a web program;

[0028] After receiving the source code resource package, the web client runs the program in the operating environment corresponding to the target source code branch based on the source code resource package, including:

[0029] Render the web page interface of the web program based on the source code resource package and display the web page interface.

[0030] Optionally, the manner in which the above-mentioned device receives the call link sent by the client includes:

[0031] Receiving a call link sent by a content distribution server;

[0032] The call link is sent by the client to the content distribution server. The content distribution server is a server in a content distribution network. The content distribution network includes multiple servers. The content distribution server is the server closest to the client among the multiple servers.

[0033] Optionally, the call link is sent by the content distribution server when the source code resource package is not cached;

[0034] The above-mentioned device returns the called source code resource package to the client in the following ways:

[0035] Return the called source code resource package to the content distribution server, so that the content distribution server returns the source code resource package to the client;

[0036] The content distribution server is used to cache the source resource package within a specified period of time after receiving the source resource package, and the source resource package cached in the content distribution server supports being called by the client within the specified period of time based on the calling link.

[0037] Optionally, the source code calling space is a source code folder in the source code repository that is associated with the target source code branch;

[0038] The identification information of the source code folder associated with the target source code branch is the directory identifier of the source code folder, and the directory identifier is the branch identifier of the target source code branch;

[0039] The source code resources in the source code branch corresponding to each operating environment of the program are isolated and called based on the source code folders associated with the source code branch corresponding to each operating environment.

[0040] Optionally, the source code resources in the source code resource package are data units stored in the source code call space in an unstructured form;

[0041] Among them, a source code resource in the source code resource package belongs to a data unit stored in the source code call space.

[0042] Optionally, the source code resource package contains at least one of the following source code resources:

[0043] Source code resources for business logic that can be triggered in the program interface of a running program, source code resources for rendering elements in the program interface as a specified style, or source code resources for determining display rules between multiple elements in the program interface.

[0044] In one aspect, the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes a method in one aspect of the present application.

[0045] In one aspect, the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor executes the method in the above aspect.

[0046] According to one aspect of the present application, a computer program product is provided, the computer program product comprising a computer program, the computer program being stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method provided in various optional modes such as the above-mentioned one aspect.

[0047] When the target source code branch of the program is triggered to update, the application obtains the source code resources in the target source code branch; the program has one or more source code branches, one source code branch corresponds to an operating environment of the program, and the target source code branch is any one of the one or more source code branches; according to the source code resources in the target source code branch, a source code resource package for running the program is constructed; the source code resource package is updated to the source code call space associated with the target source code branch; the source code resource package in the source code call space supports calling based on the calling information corresponding to the source code call space, so as to run the program in the operating environment corresponding to the target source code branch. It can be seen that the method proposed in the present application can automatically trigger the packaging of source code resources in the target source code branch to construct a source code resource package when the target source code branch of the program is triggered to update, and update the constructed source code resource package to the process in the source code call space associated with the target source code branch, thereby improving the updating efficiency of the source code resources of the program in the corresponding operating environment of the target source code branch; and, the source code resource package in the source code call space supports direct calling based on the calling information corresponding to the source code call space. It can be seen that the present application can quickly call the source code resources of the program only through the calling information, which reduces the difficulty of calling the source code resources of the program and improves the convenience of running the program. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0049] Figure 1 It is a structural diagram of a network architecture provided by this application;

[0050] Figure 2 It is a schematic diagram of a scenario for calling source code resources provided by this application;

[0051] Figure 3 It is a flowchart of a method for processing source code data provided by this application;

[0052] Figure 4 This is a schematic diagram of a scenario for building a source code resource package provided by this application;

[0053] Figure 5 It is a schematic diagram of a management interface for building a source code resource package provided by this application;

[0054] Figure 6 It is a schematic diagram of a file management interface for source code resources provided by this application;

[0055] Figure 7 This is a schematic diagram of a scenario for calling source code resources by calling a link provided by this application;

[0056] Figure 8 It is a flowchart of a source code calling method provided by this application;

[0057] Fig. 9 This is a schematic diagram of a scenario in which a client obtains source code resources provided by this application;

[0058] Fig.10 This is a flowchart of accessing source code resources provided by this application;

[0059] Figure 11a-Figure 11b This is a schematic diagram of an interface for a program operation provided by this application;

[0060] Fig.12 It is a structural schematic diagram of a source code data processing device provided by the present application;

[0061] Fig.13 It is a structural schematic diagram of a computer device provided by this application. DETAILED DESCRIPTION

[0062] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0063] This application involves cloud technology, which refers to a hosting technology that unifies hardware, software, network and other resources within a wide area network or a local area network to achieve data computing, storage, processing and sharing.

[0064] Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model. It can form a resource pool, which can be used on demand and is flexible and convenient. Cloud computing technology will become an important support. The backend services of the technical network system require a large amount of computing and storage resources, such as video websites, image websites and more portal websites. With the rapid development and application of the Internet industry, in the future, each item may have its own identification mark, which needs to be transmitted to the backend system for logical processing. Data of different levels will be processed separately. All kinds of industry data need strong system backing support, which can only be achieved through cloud computing.

[0065] The cloud technology involved in this application may mean that the source code branches of the program and the source code calling spaces associated with the source code branches can be maintained through the "cloud". Subsequently, data interaction can also be performed between the front-end and the back-end through the "cloud".

[0066] First of all, it needs to be explained that all business data collected in this application (such as source code resources and other data) are collected with the consent and authorization of the object to which the business data belongs (such as users, institutions or enterprises, etc.), and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0067] Here, the relevant technical concepts involved in this application are explained:

[0068] Object storage: Object storage, also known as object-based storage, is a computer data storage architecture designed to handle large amounts of unstructured data. It specifies data as different units and bundles metadata and unique identifiers for finding and accessing each data unit. These data units (or objects) can be stored locally, but are usually stored in the cloud to facilitate easy access to data from anywhere. Object storage has horizontal expansion capabilities, its scalability is almost unlimited, and the cost of storing large amounts of data is lower than other storage methods such as block storage.

[0069] CI / CD: refers to the combined practice of continuous integration, continuous delivery or continuous deployment. CI / CD builds a bridge between development and operations teams by implementing automation in application building, testing, and deployment.

[0070] HTML: HTML stands for Hypertext Markup Language, which is a markup language. It includes a series of tags that can unify the document format on the Internet and connect scattered Internet resources (network resources) into a logical whole. HTML text is a descriptive text composed of HTML commands, which can describe text, graphics, animations, sounds, tables, links, etc.

[0071] WebView: It is a control that displays HTML pages (or interfaces) based on the browser engine of webkit (a network toolkit). It uses the same principle as the browser to display pages.

[0072] Multiple environments: including the official environment, multiple test environments, pre-release environments, etc. The necessity of multiple environments is to avoid mutual influence between different environments, including isolation between the official environment and the test environment, and isolation between test environments with different requirements for the same project (such as the same program) when different developers develop the same project.

[0073] The present application can automatically build multiple environments of a program (the environment can be called the operating environment of the program, and the operating environment can belong to the front-end environment of the program) (such as the construction of source code resource packages for the program in different operating environments), thereby improving the construction efficiency of multiple environments of the program and improving the convenience of running the program in different operating environments. For details, please refer to the relevant description in the following embodiments.

[0074] See also Figure 1 , Figure 1 This is a schematic diagram of a network architecture provided by this application. Figure 1 As shown, the network architecture may include a server 200 and a terminal device cluster, and the terminal device cluster may include one or more terminal devices, and the number of terminal devices is not limited here. Figure 1 As shown, the multiple terminal devices may specifically include terminal device 1, terminal device 2, terminal device 3, ..., terminal device n; Figure 1 As shown, terminal device 1, terminal device 2, terminal device 3, ..., terminal device n can all be connected to the server 200 through a network, so that each terminal device can exchange data with the server 200 through the network connection.

[0075] like Figure 1 The server 200 shown can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal device can be a smart terminal such as a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, etc. The following takes the communication between the terminal device 1 and the server 200 as an example to describe the specific embodiments of the present application.

[0076] Please also see Figure 2 , Figure 2 This is a schematic diagram of a scenario for calling source code resources provided by this application. Figure 2 As shown, the server 200 can call a source code warehouse, which can be a warehouse for editing and managing source code of a program (which can be called a source code resource). The program can be any program that needs to be run, such as a program for a specific web page.

[0077] The program may have multiple source code branches in the source code repository (including source code branches f1 to f4 here), and each source code branch of the program may correspond to a different operating environment of the program. For example, source code branch f1 may correspond to the operating environment h1 of the program, source code branch f2 may correspond to the operating environment h2 of the program, source code branch f3 may correspond to the operating environment h3 of the program, and source code branch f4 may correspond to the operating environment h4 of the program.

[0078] Among them, each source code branch of the program also has an associated source code calling space, and the source code calling space associated with each source code branch is used to store and call the source code resources in the corresponding source code branch. For example, here, the source code calling space associated with source code branch f1 is source code calling space z1, the source code calling space associated with source code branch f2 is source code calling space z2, the source code calling space associated with source code branch f3 is source code calling space z3, and the source code calling space associated with source code branch f4 is source code calling space z4.

[0079] When the source code resources in a source code branch are triggered to update, the present application can automatically trigger the update of the source code resources in the source code call space associated with the source code branch through the updated source code resources in the source code branch (which can be understood as an update of the operating environment corresponding to the program).

[0080] Furthermore, each source code calling space can have corresponding calling information respectively, and the source code resources in each source code calling space (source code resources packaged from the source code branches associated with each source code calling space) support being directly called by the calling information corresponding to each source code calling space, so as to run the above program in the running environment corresponding to the associated source code branch.

[0081] For example, the source code calling space z1 may have corresponding calling information d1, through which the source code resources packaged from the source code branch f1 can be directly called in the source code calling space z1; the source code calling space z2 may have corresponding calling information d2, through which the source code resources packaged from the source code branch f2 can be directly called in the source code calling space z2; the source code calling space z3 may have corresponding calling information d3, through which the source code resources packaged from the source code branch f3 can be directly called in the source code calling space z1; the source code calling space z4 may have corresponding calling information d4, through which the source code resources packaged from the source code branch f4 can be directly called in the source code calling space z4.

[0082] Therefore, it can be understood that the terminal device 1 includes a client (such as a web client) that can run the above program, and the client can run the above program in the operating environment h1 through the above call information d1, and can also run the above program in the operating environment h2 through the above call information d2, and can run the above program in the operating environment h3 through the above call information d3, and can run the above program in the operating environment h4 through the above call information d4. The specific implementation of this process can also be seen below Figure 3 Corresponding embodiments and Figure 8 Corresponding to the relevant description in the embodiment.

[0083] By adopting the method provided in the present application, when a source code branch is triggered to update, the update of the source code call space associated with the source code branch can be automatically triggered, and the source code call space can be directly called through the corresponding call information. Therefore, the update efficiency and call efficiency of the source code resources of the program are improved, thereby improving the convenience of running the program on the client.

[0084] See also Figure 3 , Figure 3 It is a flowchart of a method for processing source code data provided by the present application. The execution subject in the embodiment of the present application may be a source code processing device, the source code processing device may be a background device, the source code processing device may be a computer device or a computer device cluster composed of multiple computer devices, the computer device may be a server, or other devices, without limitation.

[0085] like Figure 3 As shown, the method may include:

[0086] Step S101, when the target source code branch of the program is triggered to update, the source code resources in the target source code branch are obtained; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches.

[0087] Specifically, a program may have one or more source code branches in a source code repository, which may be a repository for writing and managing source code, or a git (a distributed version control system) repository. The source code in the source code repository (which may be referred to as source code resources) cannot usually be called directly.

[0088] Different source code branches of a program in a source code repository can correspond to different operating environments of the program. One source code branch can correspond to one operating environment of the program, and vice versa, one operating environment of the program can correspond to one source code branch. The source code branches of a program in different operating environments can be used to run the program in different scenarios (or environments). The operating environment can also be understood as an operating scenario. The source code resources in different source code branches of a program can be used to implement the operation or debugging of different requirements of the program (such as different testing requirements or different optimization requirements, etc.).

[0089] Optionally, the program's running environment may include a formal environment and a test environment, wherein the formal environment may have one or more types, and the test environment may also have one or more types. If a program has multiple test environments, the multiple test environments may correspond to multiple source code branches of the program, and one test environment may correspond to one source code branch of the program. The multiple source code branches corresponding to the multiple test environments may be used to implement testing of different directions of the program.

[0090] Therefore, the source code branch of the program can also be called an environment branch. It can be understood that the program's operating environment is a customized environment for the program's source code branch. The operating environment belongs to the front-end environment, that is, the operating environment can be an environment that needs to run the program on the front end (such as the client in the terminal device).

[0091] Each developer can create a corresponding source code branch of the program in the source code repository according to actual needs. Each developer can modify or test the source code resources in different source code branches of the program independently without affecting each other. Therefore, the source code resources in different source code branches of the program are usually different.

[0092] Therefore, it is understandable that the program can be run through the source code resources in each source code branch of the program to render and display the program interface of the program. However, since the source code resources in different source code branches of the program are usually different (for example, the source code resources in different source code branches of the program are optimized in different directions, so that the source code resources submitted in each source code branch of the program are different), therefore, there are usually some differences between the program interfaces rendered and displayed through the source code resources in different source code branches of the program.

[0093] However, it should be noted that the source code resources in different source code branches of the program are generally consistent, with only a small number of source code resources being different. Therefore, the program interface rendered by the source code resources in different source code branches of the program is generally the same (which can be understood as similar).

[0094] Optionally, the above program can be any program that needs to be run in a corresponding operating environment. For example, the program can be a program of a page in an app (software) (can be an h5 page (a mobile web page)), or a program of a web page in a browser (such as a PC (computer) browser) (can be referred to as a web page program), etc.

[0095] If the program is a program on an h5 page in an app, the program interface of the program can be the interface displayed on the h5 page. If the program is a program on a web page in a browser, the program interface of the program can be a web page interface.

[0096] Optionally, any one of the one or more source code branches of the program can be called a target source code branch. Since the process of processing the source code resources in each source code branch is the same and independent, the following is an explanation taking the process of processing the source code resources in the target source code branch as an example.

[0097] When the target source code branch of the program is triggered to update, the present application can automatically trigger the process of calling and updating the source code resources in the target source code branch, as described below.

[0098] When the target source code branch of the program is triggered to update, the source code processing device can obtain the source code resources in the target source code branch. Optionally, the target source code branch can be triggered to update in a manner including but not limited to any one or more of the following:

[0099] Type 1: The source code resources in the target source code branch have changed (that is, they have been updated or modified). If there are source code commits in the target source code branch, you can usually use the git command to submit the code (that is, source code) changes to the git repository (that is, source code repository).

[0100] The second type: the source code resources in the target source code branch have changed a specified number of times, that is, the source code resources in the target source code branch have been updated a specified number of times since the last trigger update. The specified number of times can be set according to the actual application scenario. By setting the specified number of times, the frequency of calling and updating the source code resources in the target source code branch can be reduced (such as reducing the frequency of building the source code resource package described below), thereby reducing the overhead of calling and updating the source code resources in the target source code branch.

[0101] The third type: the source code calling space associated with the target source code branch (the storage space for calling the source code resources in the target source code branch, see the description in step S103 below for details) has not been updated for a period of time that is greater than or equal to the period of the update cycle. The update cycle can be set according to the actual application scenario. By setting the update cycle, it can be ensured that when the source code resources in the target source code branch are updated due to some fault conditions (such as network failure or failure of the source code processing device, etc.) but the source code resources in the source code calling space are not updated, the source code resources in the source code calling space can also be updated in time.

[0102] The method in which the target source code branch is triggered to update can be set according to the actual application scenario and is not restricted.

[0103] Step S102: construct a source code resource package for running the program according to the source code resources in the target source code branch.

[0104] Specifically, the source code processing device may package the source code resources for running the program in the target source code branch to construct a source code resource package for running the program. Optionally, the process of constructing a source code resource package for running the program using the source code resources in the target source code branch may include:

[0105] The source code processing device can obtain the entry source code resource in the target source code branch. The entry source code resource can be the first source code resource required to run the program, and the entry source code resource can be used to start the program.

[0106] Since the source code resources in the target source code branch can be recursively referenced, for example, a source code branch can reference one or more other source code resources, and the one or more source code resources can then reference other source code resources, and so on, until the final referenced source code resource no longer references other source code resources.

[0107] Therefore, since the entry source code resource is the first source code resource called, the source code processing device can also obtain M source code resources with a reference relationship in the target source code branch through the entry source code resource, where M is a positive integer and the value of M can be determined according to the actual application scenario. Among them, if source code resource y1 references source code resource y2, or vice versa, source code resource y2 references source code resource y1, then it can be said that there is a reference relationship between source code resource y1 and source code resource y2.

[0108] The M source code resources may include an entry source code resource, and each source code resource in the M source code resources has a reference relationship with at least one other source code resource in the M source code resources. Among them, each source code resource in the target source code branch may be an independent code module, and each source code resource may be referenced by one or more other source code resources once or multiple times.

[0109] Among them, the source code resources in the target source code branch other than the above-mentioned M source code resources may be temporarily useless (or invalid) source code resources in the target source code branch (such as source code resources written by developers for notes or backup) and can be filtered out.

[0110] For example, if the target source code branch includes source code resources y1, source code resources y2, source code resources y3, source code resources y4, source code resources y5 and source code resources y6, source code resource y1 is the entry source code resource, and source code resource y1 references source code resources y2 and source code resources y3, source code resource y2 references source code resource y5, source code resource y3 references source code resource y6, source code resources y5 and source code resources y6 do not reference any other source code resources, therefore, M source code resources can include source code resources y1, source code resources y2, source code resources y3, source code resources y5 and source code resources y6, source code resource y4 is a temporarily useless source code resource, and source code resource y4 can be filtered out (that is, not used as a source code resource for building a source code resource package).

[0111] Then, the source code processing device may package the M source code resources having the reference relationship obtained above to construct a source code resource package for running the program.

[0112] Among them, when packaging M source code resources, the source code resources with the same business logic in the M source code resources can be packaged into one file. In addition, since the source code resources of the running program can usually be viewed at the front end, the M source code resources can also be packaged in a disordered order (such as obfuscating the business logic of the source code resources) to obtain the corresponding files, so that even if the user who can view the source code resources of the program at the front end cannot easily understand the business logic of the source code resources of the program, so as to ensure the security of the source code resources of the program, and then, the files obtained by packaging the M source code resources can constitute a source code resource package. Among them, the method of packaging the source code resources of the program can be determined according to the actual application scenario, and there is no restriction on this.

[0113] See also Figure 4 , Figure 4 This is a schematic diagram of a scenario for building a source code resource package provided by this application. Figure 4As shown, the target source code branch may include several source code resources. First, the source code processing device may obtain an entry source code resource from the target source code branch (the entry source code resource usually has specific indication information, through which the entry source code resource can be identified).

[0114] Furthermore, the source code processing device can obtain the source code resources referenced by the entry source code resource in the target source code branch, such as source code resource y1, source code resource y2, and source code resource y3. Furthermore, the source code processing device can obtain the source code resources referenced by source code resource y1, source code resource y2, and source code resource y3 in the target source code branch. Here, source code resource y1 and source code resource y2 may have no referenced source code resources, and source code resource y3 may reference source code resource y4 and source code resource y5.

[0115] Furthermore, the source code processing device can also obtain the source code resources referenced by source code resource y4 and source code resource y5 in the target source code branch. Here, source code resource y5 may have no referenced source code resources, source code resource y4 may reference source code resource y6, and source code resource y6 may have no referenced source code resources. Therefore, the reference relationship ends here, and the source code resource package of the target source code branch can be constructed through the M source code resources referenced in sequence above (including the entry source code resource, source code resource y1, source code resource y2, source code resource y3, source code resource y4, source code resource y5, source code resource y6).

[0116] Optionally, the source code resource package constructed above may include but is not limited to at least one of the following source code resources:

[0117] The first type: source code resources of business logic that can be triggered in the program interface of a running program. The source code resources can be JS (a scripting language) files. The source code resources can include the code of triggering logic (such as triggered events) for elements (such as icons or controls) in the program interface.

[0118] The second type: source code resources used to render and display elements in the program interface in a specified style (i.e., display style, such as display color, display shape, display style, etc.), which can be a CSS (a cascading style sheet) file.

[0119] The third type: source code resources used to determine the display rules between multiple elements in the program interface (such as arrangement and display rules, which can be used to indicate the relationship between the positions of the multiple elements displayed in the program interface, such as determining the display frame between the multiple elements). The source code resources can be HTML (a hypertext markup language) files, and the HTML files can be called entry files, which can be the above-mentioned entry source code resources.

[0120] Step S103, updating the source code resource package to the source code calling space associated with the target source code branch; the source code resource package in the source code calling space supports calling based on the calling information corresponding to the source code calling space, so as to run the program in the running environment corresponding to the target source code branch.

[0121] Specifically, the source code call space may be a storage space associated with the target source code branch created when or after the target source code branch is created. Different source code branches may be associated with different source code call spaces.

[0122] The source code processing device may update the constructed source code resource package to the source code calling space associated with the target source code branch, and the source code resource package in the source code calling space may be directly called.

[0123] Optionally, each source code resource in the constructed source code resource package can be stored in the source code calling space based on object storage, where object storage is a computer data storage architecture designed to process (including store) a large amount of unstructured data.

[0124] Therefore, it can be understood that each source code resource in a source code resource package can be a data unit (or object) stored in an unstructured form in the source code call space, and a source code resource in a source code resource package can belong to a data unit stored in the source code call space.

[0125] Optionally, the object storage method adopted by the present application to store source code resources in the source code call space can be a COS (a distributed storage service with no directory hierarchy, no data format restrictions, capable of accommodating massive data and supporting access via HTTP protocol (a network communication protocol) / HTTPS protocol (a secure communication transmission protocol)). The storage bucket space of the COS service has no capacity upper limit and does not require partition management. It is suitable for various scenarios such as CDN (content distribution network) data distribution, data universal processing, or data lake for big data computing and analysis.

[0126] From the above, it can be seen that since the object storage method is more suitable for storing non-structured data such as web page programs (such as source code resource packages used to run web pages), this application uses object storage to store source code resources in the source code call space, which can reduce the cost of storing source code resources and make the management of source code resources more convenient.

[0127] Furthermore, the source code resource package in the source code calling space associated with the target source code branch can be called through the calling information corresponding to the source code calling space. By calling the source code resource package, the above program can be run in the running environment corresponding to the target source code branch.

[0128] See also Figure 5 , Figure 5 This is a schematic diagram of a management interface for building a source code resource package provided by this application. Figure 5 As shown, stage 1 in the management interface can trigger the above-mentioned construction process of the source code resource package. The trigger can be manually triggered, or can be triggered by a git event (such as an event of submitting code in the target source code branch, that is, an event of updating the source code resource).

[0129] After the triggering, stage 2 (stage 2) can review the triggered process (can be manual review), and after the review is passed, stage 3 (stage 3) can be entered. Optionally, stage 2 can exist or be removed.

[0130] In stage3, you can start the process of building the source code resource package. In this process, you can first pull the git command line (such as the command line for building the source code resource package (which can be called the instruction information for building the source code resource package)), and then, you can use Bash (command processor) to build the corresponding source code resource package based on the pulled git command line, and upload (i.e. push) the built source code resource package to the internal call space (such as the corresponding source code call space) to be called later. Figure 5 The management interface shown can visually manage the process of building source code resource packages.

[0131] Optionally, the source code call space associated with the target source code branch may be a storage space in a source code repository, and the process of generating the above call information may include:

[0132] The source code processing device may obtain the addressing information of the source code repository, and the addressing information may be used to indicate the location of the source code repository. Optionally, the source code repository may be a database in a specific server, and therefore, the addressing information of the source code repository may be information for determining the IP address (Internet Protocol address) of the server, such as the addressing information may be a domain name for determining the IP address of the server.

[0133] The source code processing device can also obtain the identification information of the source code call space associated with the target source code branch, wherein the identification information of the source code call space associated with the target source code branch can be the identification information of the target source code branch (such as the branch name). In other words, the identification information of the target source code branch can be directly mapped to the identification information of the source code call space associated with the target source code branch, so that the target source code branch and the associated source code call space can accurately correspond one to one.

[0134] Then, the source code processing device can generate a link (URL) through the addressing information obtained above and the identification information of the source code calling space (or the identification information of the target source code branch). This link can be called a calling link, and the calling link can be the calling information. Through the calling link, the resource repository can be directly addressed to call the source code resource package in the source code calling space of the resource repository.

[0135] Optionally, the above-mentioned source code repository can exist in the form of a folder, the source code call space associated with the target source code branch can be a subfolder (which can be called a source code folder) in the source code repository, and different source code branches of the program can correspond to different source code folders in the source code repository.

[0136] It can be understood that the source code resources in the source code branches corresponding to each operating environment of the program in this application are isolated and called based on the source code folders associated with the source code branches corresponding to each operating environment. Alternatively, there can be multiple programs in this application, and each program has its own source code branches corresponding to several operating environments. The source code resources of each program in the source code branches corresponding to its various operating environments can also be isolated and called through the source code folders (i.e., source code call spaces) associated with each source code branch. It can be understood that the embodiment of the present application is explained by taking the principle of processing the source code resources of a program as an example, and the principles of processing the source code resources of each program are the same.

[0137] The identification information of the source code folder associated with the target source code branch can be the directory identifier of the source code folder, the directory identifier can be the name of the source code folder (i.e., the folder name), the directory identifier can be the branch identifier of the target source code branch (i.e., the identification information of the target source code branch), and the branch identifier can be the name of the target source code branch (i.e., the branch name).

[0138] Through the above process, the call information corresponding to the source code call space associated with the target source code branch can be generated, and the call information can be generated when the target source code branch is created or the source code call space associated with the target source code branch is created. It is understandable that the call information does not need to be generated again when the source code resource package in the subsequent source code call space is updated (such as when the target source code branch is triggered to update).

[0139] See also Figure 6 , Figure 6This is a schematic diagram of a file management interface for source code resources provided by the present application. Through this file management interface, visual management of source code resources (i.e., source code files) in the source code call space can be achieved. In this file management interface, visual operations such as automatic manual uploading / deletion of source code files in any specified existing source code call space, creation of a new source code call space, search for specific source code files in an existing source code call space, and setting corresponding permissions for source code files in an existing source code call space (such as calling permissions (such as permissions that can be called within a specific period of time or permissions that can be called by a specific client account, etc.)) can be achieved.

[0140] The specific process of calling the source code resource package in the source code calling space through the calling information to run the program can also be seen below Figure 8 Corresponding to the description in the embodiment.

[0141] See also Figure 7 , Figure 7 This is a schematic diagram of a scenario in which a source code resource is called by calling a link provided by this application. Figure 7 As shown, the git feature branches of the program in the source code repository (i.e., the source code branches of the program) may include a source code branch with a branch name of "feature-time", a source code branch with a branch name of "feature-style", and a source code branch with a branch name of "feature-data". The three feature branches may be source code branches for three different test environments of the program.

[0142] The source code folder associated with the source code branch to which the branch name "feature-time" belongs is the source code folder with the same directory name "feature-time", the source code folder associated with the source code branch to which the branch name "feature-style" belongs is the source code folder with the same directory name "feature-style", and the source code folder associated with the source code branch to which the branch name "feature-data" belongs is the source code folder with the same directory name "feature-data".

[0143] The source code folders to which the directory name "feature-time" belongs, the source code folders to which the directory name "feature-style" belongs, and the source code folders to which the directory name "feature-data" belongs can all contain source code resources named fission, source code resources named spring, and source code resources named Index.html. However, source code resources with the same file name contained in different source code folders may be different source code resources.

[0144] Therefore, the source code resources in the source code folder to which the above-mentioned directory name "feature-time" belongs can be called through the calling information d1 here, and the calling information d1 can include the branch name "feature-time"; the source code resources in the source code folder to which the above-mentioned directory name "feature-style" belongs can be called through the calling information d2 here, and the calling information d2 can include the branch name "feature-style"; the source code resources in the source code folder to which the above-mentioned directory name "feature-data" belongs can be called through the calling information d3 here, and the calling information d3 can include the branch name "feature-data".

[0145] The present application improves the construction efficiency and convenience of the source code resource package by automatically triggering a pipeline for building a source code resource package for running the program through the source code resources in the target source code branch of the program when the target source code branch of the program is triggered to be updated. The product in the constructed source code resource package can include multiple source code resources such as HTML, JS and CSS.

[0146] Optionally, in the present application, CI / CD (a pipeline method for continuous integration, continuous delivery or continuous deployment, which can be called a source code integration method) can be used to keep an eye on the source code submission (i.e., source code update) of each source code branch of the program. When the target source code branch of the program is triggered to update, the CI / CD pipeline can be automatically triggered to start, and the identification information of the target source code branch (such as the branch name) can be added to the pipeline variable, so that the source code resources in the target source code branch can be automatically packaged through the started pipeline to build a source code resource package. The packaged source code resource package can be temporarily stored in the pipeline construction machine (which can be a device for temporarily storing source code resource packages, which can be a server or other device). Furthermore, the constructed source code resource package can be uploaded to the source code call space associated with the target source code branch (such as the source code call space whose identification information is the same as the identification information of the target source code branch) through the identification information of the target source code branch.

[0147] Furthermore, after uploading the source code resource package to the source code call space associated with the target source code branch (which can be an overwriting update), the source code resource package in the source code call space can be directly called through the call information corresponding to the source code call space (such as a call link) to run the corresponding program. Since the front end (i.e., the client) only needs to call the relevant source code resources of the program through the call information to run the program, the efficiency of the front end calling the source code resources of the program is also improved, and the convenience of the front end running the program is improved. It can be seen that the generation and use process of the source code resource package in this application is simple, ready to use, and will not bring additional mental burden to the relevant technical personnel, and improve the experience of technical personnel in calling and using the source code resources of the program.

[0148] Furthermore, since the front end can directly call (i.e., access) the relevant source code resources of the program through calling information to run (i.e., access) the program, there is no need to maintain a proxy layer (i.e., transit layer) for managing and isolating the source code resources of the program in different operating environments. Therefore, the maintenance cost and start-up cost of the atomic source code of the program in different operating environments are also reduced.

[0149] When the target source code branch of the program is triggered to update, the application obtains the source code resources in the target source code branch; the program has one or more source code branches, one source code branch corresponds to an operating environment of the program, and the target source code branch is any one of the one or more source code branches; according to the source code resources in the target source code branch, a source code resource package for running the program is constructed; the source code resource package is updated to the source code call space associated with the target source code branch; the source code resource package in the source code call space supports calling based on the calling information corresponding to the source code call space, so as to run the program in the operating environment corresponding to the target source code branch. It can be seen that the method proposed in the present application can automatically trigger the packaging of source code resources in the target source code branch to construct a source code resource package when the target source code branch of the program is triggered to update, and update the constructed source code resource package to the process in the source code call space associated with the target source code branch, thereby improving the updating efficiency of the source code resources of the program in the corresponding operating environment of the target source code branch; and, the source code resource package in the source code call space supports direct calling based on the calling information corresponding to the source code call space. It can be seen that the present application can quickly call the source code resources of the program only through the calling information, which reduces the difficulty of calling the source code resources of the program and improves the convenience of running the program.

[0150] See also Figure 8 , Figure 8 It is a flowchart of a source code calling method provided by this application. Figure 8The corresponding embodiment specifically describes that after generating a call link corresponding to the source code call space associated with the target source code branch, the client can call the source code resource package in the source code call space through the call link to run the program in the running environment corresponding to the target source code branch. Figure 8 As shown, the method may include:

[0151] Step S201, receiving a call link sent by a client, and parsing the call link to obtain addressing information and identification information.

[0152] Specifically, the source code processing device may receive the call information sent by the client, and the call information may be a call link, and the call information may be the call information corresponding to the source code call space associated with the target source code branch. The source code processing device may parse the call link, that is, may parse and obtain the addressing information and identification information contained in the call link, the addressing information may be information for determining the location of the resource repository, and the identification information may be identification information of the source code call space associated with the target source code branch.

[0153] Optionally, in the present application, data exchange between the source code processing device (which can be understood as a background device) and the client can be carried out through a content distribution network. Therefore, the call link received by the source code processing device can be sent by a content distribution server in the content distribution network, and the call link sent by the content distribution server to the source code processing device can be sent by the client to the content distribution server.

[0154] Among them, the content distribution network may include multiple servers, and the content distribution server may be the server closest to the client in the content distribution network. In other words, the client may send a call link to the server closest to itself in the content distribution network (which may be called the above-mentioned content distribution server), thereby reducing the communication overhead and communication time between the client and the content distribution network. Furthermore, the content distribution server may redistribute the call link sent by the client to the background device (such as the source code processing device).

[0155] Optionally, the client may be a browser, and the calling link may be input in the browser and then given to the content distribution server; or, the client may be an app (software) having a WebView component (a component that can run links, also referred to as a link running component), and the calling link may be input in the app and then given to the content distribution server.

[0156] Step S202: locate the source code repository based on the addressing information, and call the source code resource package in the source code calling space of the located source code repository based on the identification information.

[0157] Specifically, the source code processing device can locate (i.e., address) the source code repository through the addressing information obtained by the above analysis, and then, can find (i.e., map to) the source code call space associated with the target source code branch in the located source code repository through the identification information obtained by the above analysis (the file path of the source code call space associated with the target source code branch in the source code repository can be determined through the identification information), and can call the source code resource package in the found source code call space.

[0158] For example, the source code processing device can determine the server IP where the source code repository is located through the addressing information, and then after establishing a connection with the server through the IP, the source code resource package in the corresponding source code call space of the resource repository in the server can be called.

[0159] Step S203, returning the called source code resource package to the client, so that the client runs the program in the running environment corresponding to the target source code branch based on the source code resource package.

[0160] Specifically, the source code processing device may return the called source code resource package to the client, and then the client may run the program in the running environment corresponding to the target source code branch through the source code resource package.

[0161] Optionally, the source code processing device may also return the called source code resource package to the client via a content distribution network, as described below.

[0162] The source code processing device may return the called source code resource package to the content distribution server, so that after receiving the source code resource package, the content distribution server may return the source code resource package to the client.

[0163] See also Fig. 9 , Fig. 9 This is a schematic diagram of a scenario in which a client obtains source code resources provided by this application. Fig. 9As shown, 1: the client can send a call link to the server closest to it in the content distribution network (which can be called a content distribution server). 2: The content distribution server can send the call link to the source code processing device. 3: Then, the source code processing device can obtain the corresponding source code resource package that needs to be called through the call link, and can send the source code resource package to the content distribution server. Alternatively, the above process can also be that the content distribution server first parses the call link to obtain addressing information and identification information. The source code repository can be present in the source code processing device. The content distribution server can address the source code processing device through the addressing information obtained by the parsing, and can give the parsed identification information to the source code processing device, so that the source code processing device can directly obtain the called source code resource package in the source code repository it has through the identification information, and return the source code resource package to the content distribution server. 4: The content distribution server can return the source code resource package to the client, and then the client can run the corresponding program through the obtained source code resource package.

[0164] Optionally, the call link sent by the content distribution server to the source code processing device in the above step S201 may be sent to the source code processing device when the content distribution server does not cache the source code resource package in the source code call space associated with the target source code branch.

[0165] Therefore, it can be understood that after receiving the above-mentioned source code resource package returned by the source code processing device, the content distribution server can cache the source code resource package within a specified period of time. The source code resource package can be cached in association with the identification information of the corresponding source code call space at the content distribution server.

[0166] Subsequently, when the client repeatedly (e.g., multiple times) calls the source code resource package within the specified time period, the content distribution server does not need to obtain the source code resource package from the source code processing device, and can directly return the cached source code resource package to the client, thereby improving the efficiency of the client calling the source code resources of the program and saving the overhead of calling the source code resources of the program.

[0167] For example, after receiving the call information sent by the client, the content distribution server can also parse the identification information of the corresponding source code call space from the call information. If there is a source code resource package cached in association with the parsed identification information in the content distribution server, the source code resource package can be directly returned to the client.

[0168] Optionally, the above-mentioned specified time period can be a time period within a specified time after the content distribution server receives the source resource package. The specified time period can be set according to the actual application scenario and is not limited. For example, if the source resource package is received at 8 o'clock, the specified time period is half an hour (it can also be set to other time periods), then the specified time period can be a time period within half an hour after 8 o'clock (i.e., the time period from 8 o'clock to 8:30).

[0169] See also Fig.10 , Fig.10 This is a flow chart of accessing source code resources provided by this application. Fig.10 As shown, the process may include:

[0170] s1: Relevant users (such as relevant technicians or developers) can submit code (i.e. source code submission) in the target source code branch to trigger the update of the target source code branch. s2: Code submission in the target source code branch can trigger the CI / CD method. s3: The triggered CI / CD method can automatically package the source code resources in the target source code branch to build the corresponding source code resource package.

[0171] s4: You can upload the built source code resource package to the corresponding source code call space in the COS source station (which can be understood as the source code repository or the device where the source code repository is located). The COS source station can be accessed through the call link (URL) corresponding to the source code call space.

[0172] s5: When the client initiates a URL access, the URL can be first given to the CDN (such as to the content distribution server in the content distribution network). s6: The CDN network performs domain name resolution and distribution on the URL. s7: The CDN can obtain the source code resource package that the client needs to call from the local cache or from the cloud (such as the COS source station) through the result of resolving the URL, and can return the source code resource package to the client. Then, the client can use the obtained source code resource package to run the program in the corresponding operating environment.

[0173] Optionally, the client may be a web client (such as a browser or software with a WebView component), and the program may be a web program. After receiving the source code resource package in the source code call space associated with the target source code branch, the client runs the program in the operating environment corresponding to the target source code branch through the source code resource package, which may include:

[0174] The client can run the source code resources in the source code resource package to render a web page interface (such as an HTML interface) of the web page program. The web page interface belongs to the program interface of the program, and the client can display the rendered web page interface. Subsequently, the client can also respond to events triggered in the web page interface by running the source code resources in the source code resource package. For example, the web page interface can include a control for starting a game. The client can respond to the event triggered for the control and render and display the corresponding game interface according to the source code resources in the running source code resource package. The event can be an event that displays the game interface after triggering the control.

[0175] See also Figure 11a-Figure 11b , Figure 11a-Figure 11b This is a schematic diagram of the interface of a program running provided by this application. Figure 11a-Figure 11b As shown, when the program is run by calling link d1, the web page interface j1 of the program can be rendered and displayed. When the program is run by calling link d2, the web page interface j2 of the program can be rendered and displayed. The web page interface j1 and the web page interface j2 can both belong to programs on the same web page (such as the lottery interface for the New Year event here). However, there may be some differences between the web page interface j1 and the web page interface j2.

[0176] The differences may include: Difference 1, the function of the content displayed at position 1a in the web page interface j1 is the same as the function of the content displayed at position 4a in the web page interface j2, but the display style of the content at position 1a may be different from the display style of the content at position 4a; Difference 2, the function of the content displayed at position 2a in the web page interface j1 is the same as the function of the content displayed at position 5a in the web page interface j2, but the display style of the content at position 2a may be different from the display style of the content at position 5a; Difference 3, the function of the content displayed at position 3a in the web page interface j1 is the same as the function of the content displayed at position 6a in the web page interface j2, but the display style of the content at position 3a may be different from the display style of the content at position 6a.

[0177] By adopting the above method provided by the present application, since various operating environments of the program correspond to a source code branch, a source code call space (the source code call space associated with the source code branch) and a call information (the call information corresponding to the source code call space), the present application can also simultaneously call (i.e., access) the source code resources of the program in multiple operating environments through multiple call information corresponding to the multiple operating environments of the program, so as to run the program in multiple operating environments at the same time without additional restrictions (such as in the traffic coloring scenario of existing applications, a client account can only run the program in one operating environment at a time). Therefore, the efficiency and convenience of running the program can be improved.

[0178] See also Fig.12 , Fig.12 : is a schematic diagram of the structure of a source code data processing device provided by the present application. The source code data processing device may be a computer program (including program code) running in a computer device. For example, the source code data processing device is an application software. The source code data processing device may be used to execute the corresponding steps of the method provided in the embodiment of the present application. Fig.12 As shown, the source code data processing device 120 may include: a trigger module 1201 , a construction module 1202 and a calling module 1203 .

[0179] The trigger module 1201 is used to obtain source code resources in the target source code branch when the target source code branch of the program is triggered to be updated; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches;

[0180] A construction module 1202 is used to construct a source code resource package for running the program according to the source code resources in the target source code branch;

[0181] The calling module 1203 is used to update the source code resource package to the source code calling space associated with the target source code branch; the source code resource package in the source code calling space supports calling based on the calling information corresponding to the source code calling space to run the program in the running environment corresponding to the target source code branch.

[0182] Optionally, the target source code branch is triggered to update in any of the following ways:

[0183] The source code resources in the target source code branch are changed, the source code resources in the target source code branch are changed a specified number of times, or the source code call space associated with the target source code branch has not been updated for a period greater than or equal to the duration of the update cycle.

[0184] Optionally, the construction module 1202 constructs a source code resource package for running the program based on the source code resources in the target source code branch, including:

[0185] Get the entry source code resources in the target source code branch; the entry source code resources are used to start the program;

[0186] Based on the entry source code resource, M source code resources with a reference relationship in the target source code branch are obtained; the M source code resources include the entry source code resource, any source code resource in the M source code resources has a reference relationship with at least one other source code resource in the M source code resources, and M is a positive integer;

[0187] Build a source code resource package based on M source code resources.

[0188] Optionally, the source code calling space belongs to the storage space in the source code repository; the process of the above-mentioned device 120 generating the calling information includes:

[0189] Obtain addressing information of the source code repository and obtain identification information of the source code call space;

[0190] Generate a call link based on the addressing information and the identification information;

[0191] Among them, the call link belongs to the call information.

[0192] Optionally, the device 120 is further used for:

[0193] Receive the call link sent by the client, and parse the call link to obtain addressing information and identification information;

[0194] Locating the source code repository based on the addressing information, and calling the source code resource package in the source code calling space of the located source code repository based on the identification information;

[0195] The called source code resource package is returned to the client, so that the client can run the program based on the source code resource package in the running environment corresponding to the target source code branch.

[0196] Optionally, the client is a web client and the program is a web program;

[0197] After receiving the source code resource package, the web client runs the program in the operating environment corresponding to the target source code branch based on the source code resource package, including:

[0198] Render the web page interface of the web program based on the source code resource package and display the web page interface.

[0199] Optionally, the manner in which the apparatus 120 receives the call link sent by the client includes:

[0200] Receiving a call link sent by a content distribution server;

[0201] The call link is sent by the client to the content distribution server. The content distribution server is a server in a content distribution network. The content distribution network includes multiple servers. The content distribution server is the server closest to the client among the multiple servers.

[0202] Optionally, the call link is sent by the content distribution server when the source code resource package is not cached;

[0203] The above-mentioned means 120 returns the called source code resource package to the client in the following ways:

[0204] Return the called source code resource package to the content distribution server, so that the content distribution server returns the source code resource package to the client;

[0205] The content distribution server is used to cache the source resource package within a specified period of time after receiving the source resource package, and the source resource package cached in the content distribution server supports being called by the client within the specified period of time based on the calling link.

[0206] Optionally, the source code calling space is a source code folder in the source code repository that is associated with the target source code branch;

[0207] The identification information of the source code folder associated with the target source code branch is the directory identifier of the source code folder, and the directory identifier is the branch identifier of the target source code branch;

[0208] The source code resources in the source code branch corresponding to each operating environment of the program are isolated and called based on the source code folders associated with the source code branch corresponding to each operating environment.

[0209] Optionally, the source code resources in the source code resource package are data units stored in the source code call space in an unstructured form;

[0210] Among them, a source code resource in the source code resource package belongs to a data unit stored in the source code call space.

[0211] Optionally, the source code resource package contains at least one of the following source code resources:

[0212] Source code resources for business logic that can be triggered in the program interface of a running program, source code resources for rendering elements in the program interface as a specified style, or source code resources for determining display rules between multiple elements in the program interface.

[0213] According to one embodiment of the present application, Figure 3 The steps involved in the source code data processing method shown can be represented by Fig.12 The source code data processing device 120 shown in FIG. 1 is executed by each module in the source code data processing device 120. For example, Figure 3 The step S101 shown in FIG. 1 can be performed by Fig.12 The trigger module 1201 in the embodiment is used to execute, Figure 3 The step S102 shown in FIG. 1 can be performed by Fig.12 The building block 1202 in is executed; Figure 3 The step S103 shown in FIG. 1 can be performed by Fig.12 The calling module 1203 in is executed.

[0214] When the target source code branch of the program is triggered to update, the application obtains the source code resources in the target source code branch; the program has one or more source code branches, one source code branch corresponds to an operating environment of the program, and the target source code branch is any one of the one or more source code branches; according to the source code resources in the target source code branch, a source code resource package for running the program is constructed; the source code resource package is updated to the source code call space associated with the target source code branch; the source code resource package in the source code call space supports calling based on the calling information corresponding to the source code call space, so as to run the program in the operating environment corresponding to the target source code branch. It can be seen that when the target source code branch of the program is triggered to update, the device proposed in the present application can automatically trigger the packaging of the source code resources in the target source code branch to construct a source code resource package, and update the constructed source code resource package to the process in the source code call space associated with the target source code branch, thereby improving the updating efficiency of the source code resources of the program in the corresponding operating environment of the target source code branch; and, the source code resource package in the source code call space supports direct calling based on the calling information corresponding to the source code call space. It can be seen that the present application can quickly call the source code resources of the program only through the calling information, which reduces the difficulty of calling the source code resources of the program and improves the convenience of running the program.

[0215] According to one embodiment of the present application, Fig.12 The various modules in the processing device 120 of the source code data shown can be respectively or all combined into one or several units to constitute, or some of the units (some) can also be split into multiple smaller sub-units in function, and the same operation can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the functions of a module can also be realized by multiple units, or the functions of multiple modules can be realized by one unit. In other embodiments of the present application, the processing device 1 of the source code data can also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented by the collaboration of multiple units.

[0216] According to one embodiment of the present application, the program can be executed by running on a general-purpose computer device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 3 A computer program (including program code) for each step involved in the corresponding method shown in Fig.12 The source code data processing device 120 shown in the figure and the source code data processing method of the embodiment of the present application are implemented. The above computer program can be recorded on a computer readable recording medium, for example, and loaded into the above computing device through the computer readable recording medium and run therein.

[0217] See also Fig.13 , Fig.13 Schematic diagram of the structure of a computer device provided by this application. Fig.13 As shown, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, in some embodiments, the computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. The communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally be at least one storage device located away from the aforementioned processor 1001. As Fig.13 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0218] exist Fig.13 In the computer device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0219] When the target source code branch of the program is triggered to update, the source code resources in the target source code branch are obtained; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches;

[0220] Build a source code resource package for running the program based on the source code resources in the target source code branch;

[0221] The source code resource package is updated to the source code call space associated with the target source code branch; the source code resource package in the source code call space supports calling based on the calling information corresponding to the source code call space, so as to run the program in the running environment corresponding to the target source code branch.

[0222] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 3 The description of the processing method of the source code data in the corresponding embodiment can also be performed as described above. Fig.12The description of the source code data processing device 120 in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here either.

[0223] In addition, it should be pointed out here that: the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program executed by the processing device 120 of the source code data mentioned above. When the processor executes the computer program, it can execute the above-mentioned Figure 3 The description of the processing method of source code data in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0224] As an example, the above-mentioned computer program may be deployed on one computer device for execution, or deployed on multiple computer devices located at one location for execution, or executed on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain network.

[0225] The computer-readable storage medium may be a processing device for source code data provided by any of the aforementioned embodiments or an internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Further, the computer-readable storage medium may also include both an internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0226] The present application provides a computer program product, which includes a computer program, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above-mentioned Figure 3The description of the processing method of the above-mentioned source code data in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0227] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.

[0228] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0229] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A method for processing source code data, characterized in that: The method comprises: When a target source code branch of a program is triggered to be updated, the source code resources in the target source code branch are obtained; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches; Building a source code resource package for running the program according to the source code resources in the target source code branch; The source code resource package is updated to the source code calling space associated with the target source code branch; the source code resource package in the source code calling space supports calling based on the calling information corresponding to the source code calling space, so as to run the program in the running environment corresponding to the target source code branch.

2. The method according to claim 1, characterized in that The target source code branch is triggered to update in any of the following ways: The source code resources in the target source code branch are changed, the source code resources in the target source code branch are changed a specified number of times, or the source code call space associated with the target source code branch has not been updated for a period greater than or equal to the duration of the update cycle.

3. The method according to claim 1, characterized in that: The step of constructing a source code resource package for running the program based on the source code resources in the target source code branch includes: Acquire the entry source code resource in the target source code branch; the entry source code resource is used to start the running of the program; Based on the entry source code resource, M source code resources having a reference relationship in the target source code branch are obtained; the M source code resources include the entry source code resource, any source code resource among the M source code resources has a reference relationship with at least one other source code resource among the M source code resources, and M is a positive integer; The source code resource package is constructed based on the M source code resources.

4. The method according to claim 1, characterized in that: The source code calling space belongs to the storage space in the source code storage repository; The process of generating the call information includes: Obtaining addressing information of the source code repository and obtaining identification information of the source code calling space; generating a call link based on the addressing information and the identification information; The calling link belongs to the calling information.

5. The method according to claim 4, characterized in that The method further comprises: Receiving the call link sent by the client, and parsing the call link to obtain the addressing information and the identification information; Locating the source code repository based on the addressing information, and calling the source code resource package in the source code calling space of the located source code repository based on the identification information; The called source code resource package is returned to the client, so that the client runs the program in the running environment corresponding to the target source code branch based on the source code resource package.

6. The method according to claim 5, characterized in that The client is a web client, and the program is a web program; After receiving the source code resource package, the web client runs the program in the operating environment corresponding to the target source code branch based on the source code resource package, including: A web page interface of the web page program is rendered based on the source code resource package, and the web page interface is displayed.

7. The method according to claim 5, characterized in that The receiving the call link sent by the client includes: Receiving the calling link sent by the content distribution server; The call link is sent by the client to the content distribution server, the content distribution server is a server in a content distribution network, the content distribution network includes multiple servers, and the content distribution server is the server closest to the client among the multiple servers.

8. The method according to claim 7, characterized in that The calling link is sent by the content distribution server when the source code resource package is not cached; The step of returning the called source code resource package to the client includes: Returning the called source code resource package to the content distribution server, so that the content sub-server returns the source code resource package to the client; The content distribution server is used to cache the source resource package within a specified period of time after receiving the source resource package, and the source resource package cached in the content distribution server supports being called by the client within the specified period of time based on the calling link.

9. The method according to claim 4, characterized in that The source code calling space is a source code folder associated with the target source code branch in the source code repository; The identification information of the source code folder associated with the target source code branch is a directory identifier of the source code folder, and the directory identifier is a branch identifier of the target source code branch; The source code resources in the source code branch corresponding to each operating environment of the program are isolated and called based on the source code folders respectively associated with the source code branch corresponding to each operating environment.

10. The method according to claim 1, characterized in that The source code resources in the source code resource package are data units stored in the source code call space in an unstructured form; Among them, a source code resource in the source code resource package belongs to a data unit stored in the source code calling space.

11. The method according to claim 1, characterized in that: The source code resource package contains at least one of the following source code resources: Source code resources of business logic that can be triggered in the program interface of the running program, source code resources used to render and display elements in the program interface as specified styles, or source code resources used to determine display rules between multiple elements in the program interface.

12. A source code data processing device, characterized in that: The device comprises: a trigger module, configured to obtain source code resources in a target source code branch of a program when the target source code branch of the program is triggered to be updated; the program has one or more source code branches, one source code branch corresponds to a running environment of the program, and the target source code branch is any one of the one or more source code branches; A construction module, used to construct a source code resource package for running the program according to the source code resources in the target source code branch; A calling module is used to update the source code resource package to the source code calling space associated with the target source code branch; the source code resource package in the source code calling space supports calling based on the calling information corresponding to the source code calling space, so as to run the program in the running environment corresponding to the target source code branch.

13. A computer program product, comprising a computer program, which implements the steps of the method according to any one of claims 1 to 11 when executed by a processor.

14. A computer device, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 11.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded by a processor and executing the method according to any one of claims 1 to 11.