Commodity information access control method and its device, equipment, medium, and product
By constructing structured definition blocks and intermediate class interfaces, product information is converted into intermediate data files, which solves the problem of data transmission between different databases in e-commerce platforms, realizes standardized access to data and cross-service transmission, and improves the System robustness and development efficiency.
Patent Information
- Application Number
- CN202111314281.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-08
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-11-08
AI Technical Summary
In the backend system of e-commerce platforms, the data encapsulation formats are different between different databases, which lead to difficulty in data transmission and lack of a unified intermediate format, which affects data interoperability and system response efficiency.
By obtaining the recorded data of product information, structured definition blocks are constructed, and using the preset intermediate class interface to convert it into intermediate data files and transmitting them to the service interface, realizing standardized access to product information and cross-service data transmission.
It has realized the standardization of the data transmission process, simplified the backend business logic of the e-commerce platform, improved development efficiency and system stability, and reduced development costs.
Smart Images

Figure CN114064044B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to data access technology, and more particularly to a commodity information access control method and its corresponding device, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] In the backend system of the e-commerce platform, a large number of online services are integrated, and it is often necessary to introduce data for each online service, especially the product information related to the product object, or sometimes it is necessary to transfer data between different databases of multiple online services. As we all know, the data encapsulation formats between different databases or different data sources may be different. If one party lacks the ability to parse the format of the other party, it will lead to the inability to read data from each other. Therefore, it is often necessary to use an intermediate format that can be parsed by all parties to achieve conversion. Among them, the comma-separated value file is a common intermediate format, which has the characteristics of convenient reading and writing and efficient access. However, there are also shortcomings, which are specifically manifested in that the support for access between databases is not comprehensive. Due to the different databases and access mechanisms used by multiple online services, it is also difficult to achieve data intercommunication between multiple online services on the same intermediate format file through a single intermediate format. Therefore, there is still room for improvement in the support mechanism for intermediate format files between multiple online services.
[0003] In e-commerce scenarios, sometimes a large amount of product information needs to be transmitted, and the amount is huge. Sometimes it is imported by users, and sometimes it needs to be transmitted across services. If the relevant business logic cannot be standardized, it will not only fail to help reduce the implementation cost of the e-commerce platform, but may also affect the response efficiency of the backend system due to frequent massive data operations, posing a hidden danger to the stable operation of the e-commerce platform. Summary of the invention
[0004] The primary purpose of the present application is to solve at least one of the above problems and to provide a commodity information access control method and its corresponding device, computer equipment, computer-readable storage medium, and computer program product.
[0005] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0006] A commodity information access control method provided to meet one of the purposes of this application includes the following steps:
[0007] Acquire record data for describing commodity information of a commodity object, wherein the record data includes attribute contents of multiple attribute fields for recording the commodity information;
[0008] Constructing a structured definition block corresponding to the record data, wherein the structured definition block corresponds to each attribute field in the record data and includes a corresponding structure unit, and the structure unit is used to map the corresponding attribute field;
[0009] Calling a preset intermediate class interface to parse the structured definition block, reading the attribute content in the record data according to the structured definition block and storing it in an intermediate data file, wherein the attribute content of the same record data is separated by preset symbols and constructed as a single line of data;
[0010] The intermediate data file is transmitted to a preset service interface, so that the service interface can access the commodity information of the commodity object based on the intermediate data file.
[0011] In a further embodiment, obtaining record data for describing commodity information of a commodity object, wherein the record data includes a plurality of attribute contents of attribute fields for recording the commodity information, includes the following steps:
[0012] Pushing an information collection page to a terminal device to receive product information of one or more product objects entered by a user;
[0013] In response to the page submission event of the user, obtaining record data corresponding to the product information of the product object entered by the user;
[0014] The preset commodity category tree classification model is used to classify the commodity title and commodity image in the commodity information of each commodity object to obtain the classification label of the corresponding commodity object, and the classification label is used as one of the attribute contents to expand the corresponding record data.
[0015] In a further embodiment, constructing a structured definition block corresponding to the record data comprises the following steps:
[0016] Creating a header class for encapsulating the structured definition block;
[0017] In the header class, a structural unit corresponding to each of the attribute fields is defined, and a non-null value annotation mark is added to the corresponding structural unit for the attribute field having a non-null value;
[0018] The header class is stored as structural description information of the acquired record data, so as to provide it to the intermediate class interface for parsing.
[0019] In a further embodiment, calling a preset intermediate class interface to parse the structured definition block, reading the attribute content in the record data according to the structured definition block and storing it in an intermediate data file, comprises the following steps:
[0020] Calling a write interface in a preset intermediate class interface and transmitting structure description information corresponding to the structured definition block to it;
[0021] The writing interface performs scanning and parsing according to the structure description information, so as to obtain the respective attribute fields by parsing the respective structure units in the structure definition block;
[0022] The write interface traverses each acquired record data according to each attribute field to read the attribute content corresponding to each attribute field, separates the attribute content of the same record data with a single symbol, and constructs all the attribute content of the same record data into a single line of data;
[0023] The write interface stores each of the single-row data in an intermediate data file in turn.
[0024] In a further embodiment, after the intermediate data file is transmitted to a preset service interface so that the service interface can access the commodity information of the commodity object based on the intermediate data file, the following steps are included:
[0025] The service interface calls the read interface in the intermediate class interface, and transmits the acquisition address of the intermediate data file to the read interface;
[0026] The reading interface acquires the intermediate data file according to the acquisition address;
[0027] The reading interface scans and parses the structured description information pre-transferred to the intermediate class interface, so as to obtain the attribute fields by parsing the structured units in the structured definition block, wherein the structured units pre-annotated with non-empty value annotations are ignored;
[0028] The reading interface reads the attribute content of the record data of each commodity object in the intermediate data file according to each attribute field, and transfers and stores it into the corresponding field of the commodity database.
[0029] In a preferred embodiment, the intermediate data file is a comma separated value file.
[0030] A commodity information access control device provided to meet one of the purposes of the present application includes: a data acquisition module, a structure definition module, a file transfer module, and a file transmission module, wherein the data acquisition module is used to acquire record data for describing commodity information of a commodity object, wherein the record data includes a plurality of attribute contents for recording attribute fields of the commodity information; the structure definition module is used to construct a structured definition block corresponding to the record data, wherein the structured definition block includes corresponding structure units corresponding to each attribute field in the record data, and the structure units are used to map the corresponding attribute fields; the file transfer module is used to call a preset intermediate class interface to parse the structured definition block, and read the attribute contents in the record data according to the structured definition block and store them in an intermediate data file, wherein the attribute contents of the same record data are separated by preset symbols and constructed as a single line of data; the file transmission module is used to transmit the intermediate data file to a preset service interface, so that the service interface can access the commodity information of the commodity object based on the intermediate data file.
[0031] In a further embodiment, the data acquisition module includes: an information collection submodule, which is used to push an information collection page to a terminal device, and is used to receive product information of one or more product objects entered by a user; a record extraction submodule, which is used to respond to a page submission event of the user, and obtain record data corresponding to the product information of the product object entered by the user; a product classification submodule, which is used to classify the product title and product image in the product information of each of the product objects using a preset product category tree classification model to obtain a classification label for the corresponding product object, and use the classification label as one of the attribute contents to expand the corresponding record data.
[0032] In a further embodiment, the structure definition module includes: a header creation submodule, which is used to create a header class for encapsulating the structured definition block; a structure refinement submodule, which is used to define structural units corresponding to each of the attribute fields in the header class, and to add non-empty value annotation marks in the corresponding structural units for attribute fields with non-empty values; and a structure description submodule, which is used to store the header class as structural description information of the acquired record data, so as to provide it to the intermediate class interface for parsing.
[0033] In a further embodiment, the file transfer module includes: a write call submodule, which is used to call the write interface in the preset intermediate class interface and transmit the structure description information corresponding to the structured definition block to it; a write parsing submodule, which is used by the write interface to scan and parse according to the structure description information, so as to obtain the various attribute fields by parsing the various structural units in the structured definition block; a write conversion submodule, which is used by the write interface to traverse each acquired record data according to each of the attribute fields, read the attribute content corresponding to each attribute field, use a single symbol to separate the attribute content of the same record data, and construct all the attribute content of the same record data into a single line of data; a write storage submodule, which is used by the write interface to store each of the single lines of data in the intermediate data file in turn.
[0034] In a further embodiment, the commodity information access control device of the present application further includes: a read call submodule, which is used for the service interface to call the read interface in the intermediate class interface, and transmit the acquisition address of the intermediate data file to the read interface; a file acquisition submodule, which is used for the read interface to acquire the intermediate data file according to the acquisition address; a read parsing submodule, which is used for the read interface to scan and parse the structured description information pre-transferred to the intermediate class interface, so as to acquire the various attribute fields by parsing the various structural units in the structured definition block, wherein the structural units pre-added with non-empty value annotation marks are ignored; a read storage submodule, which is used for the read interface to read the attribute content of the record data of each commodity object in the intermediate data file according to the various attribute fields, and transfer them to the corresponding fields of the commodity database.
[0035] In a preferred embodiment, the intermediate data file is a comma separated value file.
[0036] A computer device provided to meet one of the purposes of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the commodity information access control method described in the present application.
[0037] A computer-readable storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the commodity information access control method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the method are executed.
[0038] A computer program product provided to meet another purpose of the present application includes a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by a processor.
[0039] Compared with the prior art, the advantages of this application are as follows:
[0040] After acquiring external record data, this application converts it into a structured definition block, and then converts the relevant record data according to the structured definition block through a pre-implemented standardized intermediate class interface, converts it into an intermediate data file and transmits it to other service interfaces. This process realizes a standardized mechanism for the data transmission process, which can be implemented as standardized middleware embedded in the e-commerce platform for various online services to call, thereby realizing data transmission across online services. Similarly, for the product information of commodity objects uploaded in batches by users in an online service, the online service can also transfer it to other background services by calling the middleware implemented according to this application, realizing the standardization of data encapsulation and transmission, simplifying the business logic of the background implementation of the e-commerce platform, and helping to improve the development efficiency of the corresponding software engineering and save development costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0042] Figure 1 A flowchart of a typical embodiment of the commodity information access control method of the present application;
[0043] Figure 2 This is a schematic diagram of a process for obtaining recorded data of a commodity object from a terminal device in an embodiment of the present application;
[0044] Figure 3 A flowchart of a process of constructing structure description information through a header class in an embodiment of the present application;
[0045] Figure 4 This is a flowchart of the working process of writing an interface in an embodiment of the present application;
[0046] Figure 5 This is a flowchart of the working process of the reading interface in the embodiment of the present application;
[0047] Figure 6 This is a functional block diagram of the commodity information access control device of the present application;
[0048] Figure 7 A schematic diagram of the structure of a computer device used in this application. DETAILED DESCRIPTION
[0049] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0050] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0051] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0052] It will be understood by those skilled in the art that the "client", "terminal" and "terminal device" used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capabilities, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication on a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Service, personal communication system), which can combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant, personal digital assistant), which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System, global positioning system) receiver; conventional laptop and / or palmtop computers or other devices, which have and / or include a conventional laptop and / or palmtop computer or other device with and / or including a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or suitable for and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, for example, a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or a smart TV, a set-top box and other devices.
[0053] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.
[0054] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.
[0055] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for access.
[0056] The neural network models referenced or may be referenced in this application, unless expressly specified, can be deployed on a remote server and remotely called on the client, or can be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.
[0057] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as it is suitable for being called by the technical solution of this application.
[0058] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.
[0059] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.
[0060] A commodity information access control method of the present application can be programmed as a computer program product and deployed in a service cluster for execution, so that the method can be executed by accessing an interface opened after the computer program product is executed and performing human-computer interaction with the computer program product through a graphical user interface.
[0061] See also Figure 1 In a typical embodiment, the commodity information access control method of the present application includes the following steps:
[0062] Step S1100: Obtain record data for describing product information of a product object, wherein the record data includes a plurality of attribute contents of each attribute field for recording the product information:
[0063] The record data is the relevant data used to describe the product information of the product object. In the e-commerce platform application scenario of the present application, the record data can be obtained in two exemplary specific scenarios. One of them is that an online service obtains the product information of the product object initially entered by the user to generate the record data, and the other specific scenario is to obtain the product information of the product object that has been entered in the product database maintained by an online service through a service.
[0064] The product information includes but is not limited to various types of data such as product title, product details, product image, product attributes, etc. After entering the background system, it can be constructed as a computer data object, such as a POJO object, for example, so as to call and obtain the product information of the product object through the data object. The various data of the product information are embodied as attribute contents corresponding to multiple attribute fields. The settings of these attribute fields are determined according to the relevant database format standards of the e-commerce platform, which does not affect the embodiment of the creative spirit of this application, and those skilled in the art should be aware of this.
[0065] Correspondingly, the record data is manifested as the attribute content of each data in the commodity information used to describe the commodity object, and each attribute content corresponds to an attribute field specified for the commodity object. Therefore, the commodity information of each commodity object is thus embodied as a record data.
[0066] Step S1200: construct a structured definition block corresponding to the record data, wherein the structured definition block corresponds to each attribute field in the record data and includes a corresponding structure unit, and the structure unit is used to map the corresponding attribute field:
[0067] In order to facilitate standardized operations, the record data of each product object can be converted into structured data. In order to achieve structured conversion, it is necessary to construct a corresponding structured definition block for the record data in advance. The structured definition block is used to define the data structure of each attribute field in the record data, so that the subsequent reading and writing of the product information of the product object is more efficient.
[0068] In a preferred embodiment, the structured definition block can be described in a related general development language. The structured definition block includes a plurality of structural units in its corresponding definition file, wherein each structural unit is used to describe one of the attribute fields, so that when it is parsed, the mapping between the structural unit and its corresponding attribute field can be realized. For example, the structured definition block can include structural units corresponding to attribute fields such as product name, product title, product details, and product picture. The attribute field described by the structural unit is pre-agreed according to the data division accuracy, and those skilled in the art can flexibly implement this.
[0069] In the structured definition block, for each of the structure units, it is allowed to add a non-empty value comment mark or other type of mark corresponding to the structure unit, so as to perform corresponding read and write operations according to these marks.
[0070] The definition of the structural unit can be implemented in the form of computer program annotation. Therefore, the construction process of the structured definition block can be completed manually or automatically generated by a computer program according to the data structure of the predicted record data.
[0071] For example, Pojo (Plain Ordinary Java Object) can be used to implement the structured definition block, so that the recorded data can be further uniformly converted into standardized computer data objects in this step, which is more convenient to call. Of course, those skilled in the art can also use other efficient methods to implement the structured definition block, as long as it can serve the subsequent data transmission process of this application.
[0072] In an alternative embodiment, the structured definition block can be described by an array, and each element in the array constructs a corresponding structure unit. It is not difficult to understand that this method can achieve more efficient data processing efficiency by sacrificing the convenience brought by annotations.
[0073] Step S1300: calling a preset intermediate class interface to parse the structured definition block, reading the attribute content in the record data according to the structured definition block and storing it in an intermediate data file, wherein the attribute content of the same record data is separated by preset symbols and constructed as a single line of data:
[0074] In order to facilitate data reading and writing and adapt to the structure of the structured definition block, an intermediate class for reading and writing the structured definition block can be pre-implemented. When the intermediate class is instantiated and run, the read and write interface it provides, that is, the intermediate class interface, is called to implement the parsing of the structured definition block, and then the attribute content of the corresponding attribute field is obtained from the record data according to the structural unit in the structured definition block.
[0075] Accordingly, the intermediate class interface parses the structured definition block to obtain the attribute fields corresponding to each corresponding structural unit, and further reads the corresponding attribute content in the record data according to each attribute field, wherein the record data of each commodity object is extracted according to the attribute field to obtain the corresponding attribute content, and then the record data of a commodity object can be converted into a single-line data storage and added to an intermediate data file. In this embodiment, the intermediate data file is recommended to adopt a separated value file format, and commas, semicolons, and other preset symbols can be used to separate the various attribute contents of the same commodity object. As for the multiple attribute contents of the same commodity object, the arrangement order can correspond to the order of the attribute fields mapped by each structural unit in the structured definition block, thereby realizing the conversion of the record data into an intermediate data file according to the analysis of the structured definition block. This intermediate data file can be temporarily stored for subsequent calls.
[0076] Step S1400: transmitting the intermediate data file to a preset service interface, so that the service interface can access the commodity information of the commodity object based on the intermediate data file.
[0077] The intermediate data file prepared in this application can serve the needs of other online services and be provided to other service interfaces for processing, thereby realizing efficient transmission and convenient access of data across services. When it is necessary to transfer the intermediate data file to the service interface of the corresponding online service, the corresponding service interface of the online service can be called, and the acquisition address of the intermediate data file can be passed as a parameter. The online service can obtain the corresponding intermediate data file through the address, and then process it to access the commodity information of the corresponding commodity object based on the intermediate data file, and use this commodity information for storage, display, calculation, etc. The utilization process of the intermediate data file will be further revealed through examples in the future, which is omitted in this example.
[0078] Through this embodiment, it can be seen that after the application obtains external record data, it converts it into a structured definition block, and then converts the relevant record data according to the structured definition block through the pre-implemented standardized intermediate class interface, converts it into an intermediate data file and then transmits it to other service interfaces. This process realizes the standardized mechanism of the data transmission process, which can be implemented as a standardized middleware embedded in the e-commerce platform for various online services to call, thereby realizing data transmission across online services. Similarly, for the product information of commodity objects uploaded in batches by users in an online service, it can also be transmitted to other background services by the online service by calling the middleware implemented according to this application, realizing the standardization of data encapsulation and transmission, simplifying the business logic of the background implementation of the e-commerce platform, and helping to improve the development efficiency of the corresponding software engineering and save development costs.
[0079] See also Figure 2 In a further embodiment, the step S1100, obtaining record data for describing commodity information of a commodity object, wherein the record data includes a plurality of attribute contents for recording each attribute field of the commodity information, comprises the following steps:
[0080] Step S1110: Push an information collection page to a terminal device to receive product information of one or more product objects entered by a user:
[0081] This embodiment is suitable for a specific application scenario in which users enter product information of product objects in batches. In an online service, for example, an online service provided by a user to a merchant user to configure their online products, after responding to the user's product entry request, an information collection page is pushed to the user's terminal device, providing the user with the page to enter product information of the product object.
[0082] After receiving the information collection page, the terminal device parses and displays it. The user can manually enter the corresponding product information of the product object on the page, or batch import the product information of the product object stored locally. Generally speaking, the product information of the batch of product objects entered by the user is entered into a list on the page, and then the submit button is triggered to submit the product information of the entered product object to the backend server of the e-commerce platform. Of course, the user can also specify a remote file storing the product information of the product object for the backend server to obtain by itself.
[0083] Step S1120: In response to the page submission event of the user, obtain the record data corresponding to the product information of the product object entered by the user:
[0084] When the user submits the product object he / she has entered, a page submission event is triggered. The backend server responds to the event and obtains the product information of the product object entered by the user. Usually, the product information of the product object submitted by the user is pre-constructed into the record data according to the inherent business logic of the online service. The record data can be the default packaging format of the online service itself.
[0085] Step S1130: Use a preset commodity category tree classification model to classify the commodity title and commodity image in the commodity information of each commodity object to obtain a classification label of the corresponding commodity object, and use the classification label as one of the attribute contents to expand the corresponding record data:
[0086] There is no need to enter classification labels for the product objects submitted by users. After the online service receives the record data of the user's product information, it can classify each product object using a category tree classification model that has been pre-trained to a convergent state to obtain the classification label corresponding to each product object.
[0087] The category tree classification model can extract deep semantic information based on the product title and / or product image in the product information of the product object, obtain the corresponding text feature vector and / or image feature vector, and then classify according to the text feature vector and / or image feature vector, and map it to the category tree structure of the e-commerce platform to obtain a classification path, which contains multiple classification labels in the category tree hierarchy with affiliation as the corresponding classification label of the product object. The category tree classification model can be implemented using a neural network model, for example, using a Bert model to extract the text feature vector for classification, or using a Resnet series model to extract the image feature vector for classification. When both text feature vectors and image feature vectors exist, the two can be simply spliced into a comprehensive feature vector before classification.
[0088] It can be understood that the category tree classification model is pre-trained to a convergent state and then put into use. It can be trained with a large number of samples consisting of product titles and / or product images, and the manually annotated classification labels corresponding to these product titles and product images are used as supervisory labels in the training process to perform gradient updates on the category tree classification model to promote the model to converge as quickly as possible.
[0089] After obtaining the corresponding classification label of each commodity object through the category tree classification model, the classification label can be added to the commodity information of each commodity object as the attribute content corresponding to another independent attribute field, thereby completing the expansion of the record data of each commodity object.
[0090] In this embodiment, it is adapted to the specific application scenario in which users upload product information of product objects. The category tree classification model expands the record data of the product objects according to the product information uploaded by the users, and implements the expansion preprocessing of the record data. This can save users the trouble of self-classification, improve data entry efficiency, avoid situations such as inconsistent data classification standards, and comprehensively improve data access efficiency.
[0091] See also Figure 3 In a further embodiment, the step S1200, constructing a structured definition block corresponding to the record data, comprises the following steps:
[0092] Step S1210: Create a header class for encapsulating the structured definition block:
[0093] In this embodiment, Pojo is used as a tool to construct a header class for encapsulating the structured definition block. Therefore, the structured definition block can be described accordingly using the corresponding language specification of Pojo.
[0094] Step S1220: define the structural units corresponding to the attribute fields in the header class, and add non-null value annotation marks to the corresponding structural units for the attribute fields with non-null values:
[0095] In the process of constructing the header class, each attribute field in the record data of the commodity object is usually regulated by the data structure of the e-commerce platform. Based on this, a corresponding structural unit is defined for each attribute field, so that each structural unit is used to map an attribute field. The corresponding attribute field can be operated by calling the structural unit to achieve data access. For any structural unit, a non-empty value annotation mark can be added as needed for verification during data access.
[0096] Step S1230: Store the header class as the structural description information of the acquired record data, so as to provide it to the intermediate class interface for parsing.
[0097] In order to facilitate calling, the header class can be stored as the structural description information of the acquired record data, and then transmitted to the intermediate class interface. When the intermediate class interface is subsequently instantiated and accessed, each structural unit can be parsed according to the structural description information so as to operate each corresponding attribute field and obtain the corresponding attribute data of each attribute field.
[0098] This embodiment implements the structured definition block as a header class, which is convenient for reference at the computer program development level, and reflects the convenience brought by structuring in the process of computer program operation, which can simplify the standardized development of multiple projects and significantly improve development efficiency.
[0099] See also Figure 4 In a further embodiment, the step S1300, calling a preset intermediate class interface to parse the structured definition block, reading the attribute content in the record data according to the structured definition block and storing it in the intermediate data file, includes the following steps:
[0100] Step S1310: calling the write interface in the preset intermediate class interface and transmitting the structure description information corresponding to the structured definition block to it:
[0101] The intermediate class interface is implemented by referencing the structured definition block and performing corresponding analysis on the structured definition block. Therefore, when the record data needs to be operated, the intermediate class interface needs to be called, specifically the write interface therein to write the record data into the corresponding intermediate data file. When calling the write interface, the structured definition block can be passed as a parameter, which is reflected at the code execution level. For example, to adapt to the situation where the structured definition block is a header class, it can be a computer object instantiated by the header class.
[0102] Step S1320: The write interface performs scanning and parsing according to the structure description information, so as to obtain the attribute fields by parsing the structure units in the structure definition block:
[0103] After the writing interface obtains the structural description information, it scans and parses it line by line, thereby completing the parsing of each structural unit to obtain the attribute fields mapped to each structural unit, thereby facilitating the next step of operation.
[0104] Step S1330: the write interface traverses each acquired record data according to each attribute field to read the attribute content corresponding to each attribute field, uses a single symbol to separate the attribute content of the same record data, and constructs all the attribute content of the same record data into a single line of data:
[0105] After the write interface learns about each attribute field, it can traverse each attribute content in each record data obtained, read the attribute content corresponding to each attribute field based on the correspondence between the attribute field and the attribute content, and read out the full commodity information of each commodity object in succession. The attribute content of the same commodity object is converted into a single line of data by the write interface, and each attribute content is separated by a comma.
[0106] Step S1340: the write interface sequentially stores each of the single-row data in an intermediate data file.
[0107] For a single row of data corresponding to each commodity object, the writing interface stores it in an intermediate data file, and the intermediate data file can be stored as a CSV file, wherein the commodity information of each commodity object is stored as a row in the CSV file.
[0108] In this embodiment, the generation of intermediate data files is standardized through the write interface in the intermediate class interface, the data conversion interface is unified, standardization is achieved, and it is convenient to serve multiple software development projects, which helps to improve the efficiency of software engineering development.
[0109] See also Figure 5 In a further embodiment, after the step S1400, in which the intermediate data file is transmitted to a preset service interface so that the service interface can access the commodity information of the commodity object based on the intermediate data file, the following steps are included:
[0110] S2100, the service interface calls the read interface in the intermediate class interface, and transmits the acquisition address of the intermediate data file to the read interface:
[0111] As another online service different from the online services for generating intermediate data files in the previous embodiments, it can provide a service interface for calling. The online service for generating intermediate data files can transmit the intermediate data files by calling the service interface. When providing the intermediate data files, it can be achieved by passing the corresponding acquisition address to the service interface.
[0112] After the service interface obtains the intermediate data file, it further calls the standardized reading interface in the intermediate class interface, and similarly passes the acquisition address of the intermediate data file to the reading interface so that the reading interface can obtain the intermediate data file to read data.
[0113] S2200, the reading interface obtains the intermediate data file according to the acquisition address:
[0114] Correspondingly, the reading interface obtains the intermediate data file according to the acquisition address, and downloads it to the local so as to read the specific data therein.
[0115] S2300, the reading interface scans and parses the structured description information pre-transferred to the intermediate class interface, so as to obtain the attribute fields by parsing the structured units in the structured definition block, wherein the structured units pre-annotated with non-empty value annotations are ignored:
[0116] Similar to the write interface, the read interface can also obtain the structured description information by itself and scan and parse it line by line, so as to obtain each corresponding attribute field through each structural unit in the structured definition block. For the structural unit with a non-empty value annotation mark added in advance, the acquisition of its attribute field can be ignored here. It can be seen that the role of the annotation mark here is to realize the protocol language between the write interface and the read interface. As for the function realized by the annotation mark, it can be completely pre-agreed by the write interface and the read interface.
[0117] S2400, the reading interface reads the attribute content of the record data of each commodity object in the intermediate data file according to each attribute field, and transfers it to the corresponding field of the commodity database.
[0118] After the reading interface learns the specific structure of the structured definition block, it actually grasps the specific data structure in the intermediate data file. Based on this, it can read out the attribute content corresponding to each attribute field of each commodity object one by one, and then transfer each attribute content to the corresponding field of the commodity database preset by the e-commerce platform, thereby realizing the entire data storage process of commodity objects across online services.
[0119] It can be seen that the write interface and the read interface have the same logic. For the same business logic, common code can be pre-implemented to optimize the code logic. Those skilled in the art can implement this flexibly.
[0120] This embodiment shows the process of transferring the product information of the product object entered by the user to the product database of the e-commerce platform through cross-service cooperation, revealing the advantages achieved by the present application through the definition of structured definition, intermediate data files, and intermediate class interfaces. It is not difficult to see that through such implementation logic, the relationship between online services and data reading and writing logic is decoupled, which facilitates independent development of each end, improves software engineering development efficiency, and frees a large number of online services from the constraints of technical implementation of complex communications, which helps to enhance the robustness of the background system.
[0121] See also Figure 6, a commodity information access control device provided for one of the purposes of the present application comprises: a data acquisition module 1100, a structure definition module 1200, a file transfer module 1300, and a file transmission module 1400, wherein the data acquisition module 1100 is used to acquire record data for describing commodity information of a commodity object, wherein the record data comprises a plurality of attribute contents for recording attribute fields of the commodity information; the structure definition module 1200 is used to construct a structure definition block corresponding to the record data, wherein the structure definition block corresponds to each attribute field in the record data. It comprises corresponding structural units, which are used to map corresponding attribute fields; the file transfer module 1300 is used to call a preset intermediate class interface to parse the structured definition block, read the attribute content in the record data according to the structured definition block, and store it in an intermediate data file, wherein the attribute content of the same record data is separated by preset symbols and constructed as a single line of data; the file transfer module 1400 is used to transfer the intermediate data file to a preset service interface, so that the service interface can access the product information of the product object based on the intermediate data file.
[0122] In a further embodiment, the data acquisition module 1100 includes: an information collection submodule, which is used to push an information collection page to a terminal device, and is used to receive product information of one or more product objects entered by a user; a record extraction submodule, which is used to respond to a page submission event of the user, and obtain record data corresponding to the product information of the product object entered by the user; a product classification submodule, which is used to classify the product title and product image in the product information of each of the product objects using a preset product category tree classification model to obtain a classification label of the corresponding product object, and use the classification label as one of the attribute contents to expand the corresponding record data.
[0123] In a further embodiment, the structure definition module 1200 includes: a header creation submodule, used to create a header class for encapsulating the structured definition block; a structure refinement submodule, used to define structural units corresponding to each of the attribute fields in the header class, and to add non-null value annotation marks in the corresponding structural units for attribute fields with non-null values; and a structure description submodule, used to store the header class as structural description information of the acquired record data, so as to provide it to the intermediate class interface for parsing.
[0124] In a further embodiment, the file transfer module 1300 includes: a write call submodule, which is used to call the write interface in the preset intermediate class interface and transmit the structure description information corresponding to the structured definition block to it; a write parsing submodule, which is used by the write interface to scan and parse according to the structure description information, so as to obtain the various attribute fields by parsing the various structural units in the structured definition block; a write conversion submodule, which is used by the write interface to traverse each acquired record data according to each of the attribute fields, read the attribute content corresponding to each attribute field, use a single symbol to separate the attribute content of the same record data, and construct all the attribute content of the same record data into a single line of data; a write storage submodule, which is used by the write interface to store each of the single-line data in the intermediate data file in turn.
[0125] In a further embodiment, the commodity information access control device of the present application further includes: a read call submodule, which is used for the service interface to call the read interface in the intermediate class interface, and transmit the acquisition address of the intermediate data file to the read interface; a file acquisition submodule, which is used for the read interface to acquire the intermediate data file according to the acquisition address; a read parsing submodule, which is used for the read interface to scan and parse the structured description information pre-transferred to the intermediate class interface, so as to acquire the various attribute fields by parsing the various structural units in the structured definition block, wherein the structural units pre-added with non-empty value annotation marks are ignored; a read storage submodule, which is used for the read interface to read the attribute content of the record data of each commodity object in the intermediate data file according to the various attribute fields, and transfer them to the corresponding fields of the commodity database.
[0126] In a preferred embodiment, the intermediate data file is a comma separated value file.
[0127] In order to solve the above technical problems, the present application also provides a computer device. Figure 7As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor may implement a commodity information access control method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor may execute the commodity information access control method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0128] In this embodiment, the processor is used to execute Figure 6 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the commodity information access control device of this application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0129] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the commodity information access control method of any embodiment of the present application.
[0130] The present application also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any embodiment of the present application when executed by one or more processors.
[0131] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0132] In summary, this application realizes the standardization of the data transmission process in a multi-online service environment, facilitates data transmission across services, simplifies business development logic, and improves the robustness of the background system.
[0133] Those skilled in the art will appreciate that the various operations, methods, steps, measures, and schemes in the processes discussed in this application may be alternated, altered, combined, or deleted. Further, other steps, measures, and schemes in the various operations, methods, and processes discussed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted. Further, the steps, measures, and schemes in the prior art that are similar to those disclosed in this application may also be alternated, altered, rearranged, decomposed, combined, or deleted.
[0134] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A commodity information access control method, It is characterized in that The steps include: Acquire record data for describing commodity information of a commodity object, wherein the record data includes attribute contents of multiple attribute fields for recording the commodity information; Constructing a structured definition block corresponding to the record data, wherein the structured definition block corresponds to each attribute field in the record data and includes a corresponding structure unit, and the structure unit is used to map the corresponding attribute field; Calling a preset intermediate class interface to parse the structured definition block, reading the attribute content in the record data according to the structured definition block and storing it in an intermediate data file, wherein the attribute content of the same record data is separated by preset symbols to construct a single line of data; including: calling a write interface in the preset intermediate class interface and transmitting the structure description information corresponding to the structured definition block to it; the write interface scanning and parsing according to the structure description information to obtain the attribute fields by parsing the various structural units in the structured definition block; the write interface traversing each acquired record data according to each attribute field to read the attribute content corresponding to each attribute field, using a single symbol to separate the attribute content of the same record data, and constructing all the attribute content of the same record data into a single line of data; the write interface sequentially stores each of the single lines of data in the intermediate data file in rows; The intermediate data file is transmitted to a preset service interface so that the service interface can access the commodity information of the commodity object based on the intermediate data file, including: the service interface calls the read interface in the intermediate class interface and transmits the acquisition address of the intermediate data file to the read interface; the read interface obtains the intermediate data file according to the acquisition address; the read interface scans and parses the structured description information pre-passed to the intermediate class interface to obtain the various attribute fields by parsing the various structural units in the structured definition block, wherein the structural units pre-added with non-empty value annotation marks are ignored; the read interface reads the attribute content of the record data of each commodity object in the intermediate data file according to the various attribute fields, and transfers them to the corresponding fields of the commodity database.
2. The commodity information access control method according to claim 1, It is characterized in that Acquiring record data for describing commodity information of a commodity object, wherein the record data includes a plurality of attribute contents of attribute fields for recording the commodity information, comprises the following steps: Pushing an information collection page to a terminal device to receive product information of one or more product objects entered by a user; In response to the page submission event of the user, obtaining record data corresponding to the product information of the product object entered by the user; The preset commodity category tree classification model is used to classify the commodity title and commodity image in the commodity information of each commodity object to obtain the classification label of the corresponding commodity object, and the classification label is used as one of the attribute contents to expand the corresponding record data.
3. The commodity information access control method according to claim 1, It is characterized in that Constructing a structured definition block corresponding to the record data includes the following steps: Creating a header class for encapsulating the structured definition block; In the header class, a structural unit corresponding to each of the attribute fields is defined, and a non-null value annotation mark is added to the corresponding structural unit for the attribute field having a non-null value; The header class is stored as structural description information of the acquired record data, so as to provide it to the intermediate class interface for parsing.
4. The commodity information access control method according to any one of claims 1 to 3, It is characterized in that The intermediate data file is a comma separated value file.
5. A commodity information access control device, It is characterized in that include: A data acquisition module, used to acquire record data for describing commodity information of a commodity object, wherein the record data includes a plurality of attribute contents of each attribute field for recording the commodity information; A structure definition module, used to construct a structure definition block corresponding to the record data, wherein the structure definition block corresponds to each attribute field in the record data and includes a corresponding structure unit, and the structure unit is used to map the corresponding attribute field; The file transfer module is used to call a preset intermediate class interface to parse the structured definition block, read the attribute content in the record data according to the structured definition block, and store it in the intermediate data file, wherein the attribute content of the same record data is separated by preset symbols to construct a single line of data; including: calling a write interface in the preset intermediate class interface and transmitting the structure description information corresponding to the structured definition block to it; the write interface scans and parses according to the structure description information to obtain the attribute fields by parsing each structural unit in the structured definition block; the write interface traverses each acquired record data according to each attribute field to read the attribute content corresponding to each attribute field, uses a single symbol to separate the attribute content of the same record data, and constructs all the attribute content of the same record data into a single line of data; the write interface stores each of the single lines of data in the intermediate data file in turn; A file transfer module, used for transferring the intermediate data file to a preset service interface so that the service interface can access the commodity information of the commodity object based on the intermediate data file, including: the service interface calls the read interface in the intermediate class interface and transmits the acquisition address of the intermediate data file to the read interface; the read interface acquires the intermediate data file according to the acquisition address; the read interface scans and parses the structured description information pre-passed to the intermediate class interface to acquire the various attribute fields by parsing the various structural units in the structured definition block, wherein the structural units pre-added with non-empty value annotation marks are ignored; the read interface reads the attribute content of the record data of each commodity object in the intermediate data file according to the various attribute fields, and transfers them to the corresponding fields of the commodity database.
6. A computer device comprising a central processing unit and a memory, It is characterized in that The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 4.
7. A computer-readable storage medium, It is characterized in that It stores a computer program implemented according to the method described in any one of claims 1 to 4 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
8. A computer program product comprising a computer program / instructions, It is characterized in that When the computer program / instructions are executed by a processor, the steps of the method described in any one of claims 1 to 4 are implemented.
